Subject: Re: floating point errors with Digitalk ST-V
References: <425jeu$6oh@ornews.intel.com> <42ggq3$5hl@news1.delphi.com>
Date: Fri, 08 Sep 95 08:51:49 +1000     
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!univ-lyon1.fr!swidir.switch.ch!simtel!harbinger.cc.monash.edu.au!news.cs.su.oz.au!tmx!steve
From: steve@tmx.mhs.oz.au(Steve Hayes)
Newsgroups: comp.lang.smalltalk
Message-ID: <09-08-1995.2510@steve>
Followup-To: comp.lang.smalltalk
Lines: 29

In article <42ggq3$5hl@news1.delphi.com> jsutherland@BIX.com (Jeff Sutherland) 
writes:
>Patrick D. Logan wrote:
>>>>I'm having problems with the following  floating point exceptions:
>>>>
>>>>0.0 raisedTo: 2.   Gives me a 'Divide by zero' exeption,
>>>>
>>>>A exp.    where A < -52000 gives me a Float underflow exception.
>>
>>Digitalk 3.01 gets the first one correct: 0.0
>>
>>It still gives an underflow for the second, but (without doing the math)
>>isn't that to be expected?
>>
>>-- 
>>mailto:Patrick_D_Logan@ccm.jf.intel.com
>
>ENFIN Smalltalk deals with both of these correctly, i.e. yields 0 in both
>cases.
>

I'm not sure that 0 is the "correct" answer to the second problem (large negative 
exponentials). I am sure that the behaviour you want depends on your domain. In 
numerical analysis related domains (which may include some financial domains) you 
may want to know that you have produced an underflow rather than a true zero. There 
are strategies to recover from this by appropriately scaling the problem. Numeric 
underflow might be a signal to change strategy.

Steve Hayes
