Difference between revisions of "TestNumPoly"

From ApCoCoAWiki
m
m
 
Line 1: Line 1:
 
<command>
 
<command>
<title>TestNumericalNumber</title>
+
<title>TestNumPoly</title>
 
<short_description>Compares two numerical polynomials</short_description>
 
<short_description>Compares two numerical polynomials</short_description>
 
<syntax>
 
<syntax>

Latest revision as of 17:21, 12 October 2009

TestNumPoly

Compares two numerical polynomials

Syntax

ApCoCoATest.TestNumericalNumber(f: POLY, e: POLY, Eps: RAT):LIST

Description

This function compares two numerical polynomials e and f. The sum over the absolute values of the coefficients of e-f must be smaller than Eps.

  • @param Found: The first numerical polynomial

  • @param Expected: The second numerical polynomial

  • @param Eps: The allowed difference between the two polynomials

  • @return A list. First entry is a boolean, its value is TRUE, if the test has been passed. If FALSE, the list contains also the expected and the found polynomial.

Example

F := 0.212 x + 2.103 xy; E := 0.00001 x^2 + 0.214 x + 2.1 xy;
ApCoCoATest.TestNumPoly(F,E,0.1);

[TRUE]
-------------------------------
F := 0.212 x + 2.103 xy; E := 0.00001 x^2 + 0.214 x + 2 xy;
ApCoCoATest.TestNumPoly(F,E,0.01);

[FALSE, 2103/1000xy + 53/250x, 1/100000x^2 + 2xy + 107/500x]
-------------------------------