What, exactly, would be warned against?

Addition of something that is too small to cause a change
in the result would be easy to check for, it could be made part of
the addition routine;

if warnings are on, issue a warning when 


$d != 0 and ($c + $d) == $c

this could be checked before the operation, by comparing
the exponent of $d against (the exponent of $c minus the
bits of accuracy in out representations)


In the e example, the result would get pretty screwy before
the warning kicks in; maybe a threshold could be added into
the condition that causes the warning.




"John Nicol (WEBTV)" wrote:
> 
> Sounds like a useful warning, all right.
> 
> -----Original Message-----
> From: David L. Nicol [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 16, 2001 2:56 PM
> To: John Nicol (WEBTV)
> Subject: A funny thing about e
> 
> I wrote a geometricly progressing e generator
> 
>  perl -le '$n=1; print "$n   \t",((1 + (1/$n))** $n) while $n*=1.001'
> 
> and initially, it converges on e.  Then it runs out of accuracy and
> re converges on 1.  There might be something interesting there.  I don't
> know if the behavior of overloaded double precision floating point is
> interesting or not:  it is certainly a popular form of numeric failure,
> as people forget about its limits of usefulness.  When to throw away
> a result as meaningless is certainly an important piece of wisdom,
> I do not know any programming languages that do it for you -- issue a
> warning when you've overloaded your accuracy instead of merrily
> returning
> you your noise -- what do you think?
> 
> --
>                       David Nicol 816.235.1187 [EMAIL PROTECTED]
> If God had meant us to compute securely, He'd have given
> us more prime numbers! -- Casey Schaufler

-- 
                      David Nicol 816.235.1187 [EMAIL PROTECTED]
If God had meant us to compute securely, He'd have given
us more prime numbers! -- Casey Schaufler

Reply via email to