AssertEqualsNumericalPoly
From ApCoCoAWiki
Revision as of 17:54, 22 June 2010 by 79.208.158.76 (talk) (New page: <command> <title>AssertEqualsNumericalPoly</title> <short_description>Compares two numerical polynomials</short_description> <syntax> $apcocoa/ts/assert.AssertEqualsNumericalPoly(Result: P...)
AssertEqualsNumericalPoly
Compares two numerical polynomials
Syntax
$apcocoa/ts/assert.AssertEqualsNumericalPoly(Result: POLY, Expected: POLY, Eps: RAT, ErrMsg: STRING)
Description
This function compares two numerical polynomials F:='Result' and G:='Expected'. The sum over the absolute values of the coefficients of F-G must be smaller than epsilon 'Eps'. If the polynomials are numerically not the same it throws an error and prints the error message 'ErrMsg'.
@param Result: The first numerical polynomial
@param Expected: The second numerical polynomial
@param Eps: Epsilon
@param ErrMsg: Error Message
Example
F := 0.212*x + 2.103*xy; G := 0.00001*x^2 + 0.214*x + 2.1*xy; $apcocoa/ts/assert.AssertEqualsNumericalPoly(F,G,0.1,"Polynomials are numerically not the same."); -- throws no error F := 0.212*x + 2.103*xy; E := 0.00001*x^2 + 0.214*x + 2*xy; $apcocoa/ts/assert.AssertEqualsNumericalPoly(F,G,00.1,"Polynomials are numerically not the same."); -- throws an error