Float>>exp underflows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Float>>exp underflows

Howard Oh
Hi.

Float>>exp makes an underflow error if the float is very big negative
number.
In math fields, exp is used many places with big negative numbers but
underflows error is not wanted for most cases.
Float will make round-off error(not a programer error but a mathematical
error) each time they undertake the math operations. We all accept that
errors. Why not for exp operation?

proposing...
Float>>exp

 ^[CRTLibrary default exp: self] on: Error do: [:e| 0.0]

Hwa Jong Oh


Reply | Threaded
Open this post in threaded view
|

Re: Float>>exp underflows

Aaron Wieland
You can disable underflow errors by evaluating

        Processor activeProcess fpeMask: 3

assuming that the original value of the floating-point error mask was 1
(_EM_UNDERFLOW = 2, so the desired value is 1 + 2).  Check the CRTConstants pool
dictionary for other types of floating point errors that may be disabled.

I was helped with this problem a long time ago, so search the archives for the
old Dolphin newsgroup if you want more information.  Look for the thread titled
"The New Math" that occurred August 18-19, 1999.

Cheers,
-- Aaron Wieland