[Ecls-list] How to get floating point underflow to yield zero?
Raymond Toy
toy.raymond at gmail.com
Thu May 1 00:20:31 UTC 2008
Mark Hoemmen wrote:
> Robert Dodier wrote:
>
>> In working through the Maxima test suite, there is at least one error
>> which is caused by floating point underflow. Other Lisp implementations
>> let floating point underflow yield zero, and that is what Maxima expects.
>> It appears that floating point underflow causes an error in ECL.
>> How can I convince ECL to yield zero instead? Thanks for your help.
>>
>
> I sent a personal e-mail with a possible solution -- FYI the idea is to
> modify the floating-point status word so that underflow signals (I
> _think_ there is such a thing), catch the signal, and handle it with an
> appropriate restart (substitute in zero for the denorm number).
>
If you're going to modify the status word, might as well modify the
control word and disable the underflow exception completely.
> FYI, gradual underflow is mandated by the IEEE 754 floating-point
> standard, so it's Maxima itself and the other Lisp implementations that
> are noncompliant, rather than ECL.
>
>
I'm pretty sure IEEE 754 says gradual underflow is required, but you are
explicitly allowed not to signal anything on underflow. I think most
Lisps turn this off because underflow is usually harmless and signaling
on underflow is annoying.
Ray
More information about the ecl-devel
mailing list