chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] CR: Division by inexact zero should return infinit


From: John Cowan
Subject: Re: [Chicken-hackers] CR: Division by inexact zero should return infinity/nan
Date: Thu, 25 Aug 2011 09:44:13 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

Alaric Snell-Pym scripsit:

> Dividing by an inexact zero to get an inexact infinity is much safer. If
> you divide by a very small number you can easily get a near-infinite
> number in FP anyway; going slightly smaller (to an inexact zero) would
> then produce a correspondingly slightly larger (inexact infinity)
> result, rather than a nasty surprise :-)

Indeed, numbers sufficiently close to zero (called denormalized numbers)
actually have +inf.0 as their inverse:

#;1> (/ 4.322644347104e-314)
+inf.0

-- 
If I read "upcoming" in [the newspaper]              John Cowan
once more, I will be downcoming                      http://www.ccil.org/~cowan
and somebody will be outgoing.                       address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]