%mathpiper,def="IsZero"

//10 # IsZero(x_IsNumber) <-- (DivideN( Round( MultiplyN(x, 10^BuiltinPrecisionGet()) ), 10^BuiltinPrecisionGet() ) = 0);

// these should be calls to MathSign() and the math library should do this. Or it should be just MathEquals(x,0).
// for now, avoid underflow and avoid IsZero(10^(-BuiltinPrecisionGet())) returning True.
10 # IsZero(x_IsNumber) <-- ( MathSign(x) = 0 Or AbsN(x)  < PowerN(10, -BuiltinPrecisionGet()));
60000 # IsZero(_x) <-- False;

//Note:tk:moved here from univariate.rep.
20 # IsZero(UniVariate(_var,_first,_coefs)) <-- IsZeroVector(coefs);

%/mathpiper



%mathpiper_docs,name="IsZero",categories="User Functions;Numbers (Predicates);Predicates"
*CMD IsZero --- test whether argument is zero
*STD
*CALL
	IsZero(n)

*PARMS

{n} -- number to test

*DESC

{IsZero(n)} evaluates to {True} if
"n" is zero. In case "n" is not a number, the function returns
{False}.

*E.G.

In> IsZero(3.25)
Result: False;
In> IsZero(0)
Result: True;
In> IsZero(x)
Result: False;

*SEE IsNumber, IsNotZero
%/mathpiper_docs