Squaring of zero value returns wrong result

Create issue
Issue #853 resolved
Former user created an issue

Try to square an expression that evaluates to zero, in the most simple case (0)^2. The result should be well defined (=0), but SpeedCrunch 0.12 returns NaN.

The original expression where I encountered this error was sqrt(((0*pi/(96e-3))^2)) which results in "undefined argument domain". It would be helpful if NaN would appear there somewhere since this error was kind of misleading. Thanks

Comments (4)

  1. Helder Correia repo owner

    Running in latest development master code:

    (0)^2
    = 0
    
    (0*pi/(96e-3))^2
    = 0
    
    sqrt(((0*pi/(96e-3))^2))
    = 0
    

    Whatever was broken in 0.12, seems to be fixed now. @tey @polwel Do you guys remember this issue from before?

  2. Log in to comment