sign function, roots & integers vs rational numbers
- May 12, 2017
- 3 replies
- 2804 views
Hello dear community !
Results of sign function in the attached worksheet are quite tricky.
When calculations for a root under the argument of sign function are done only with integers the result is always like expected, i. e. 0 ?
Why this behavior ? Binary representation of numbers in numeric engine of Mcd...? I'd have wished a more consistent implementation of sign function, for example in agreement with the precision given by TOL or of the symbolic calculus (like in Mcd2001), or without differences between integers and rational (real) numbers...
Same behavior in Mcd Prime ?
I've used this function for roots testing in a program and I was surprised to discover that thus I missed some, like in the case of p30f in attached, where the output of sign is not 0 (zero), as expected for a root of the polynomial in sign argument.
In order to make sign function work evenly in all cases I added round built-in function, the version with two arguments, the second being -log(TOL). Are there alternatives to this approach, since time execution of my program can become an issue ?
Best regards, Liv.
An old thread is about a similar issue : Problem with sign function - PTC Community

