[Top][All Lists]

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

[Chicken-users] Re: IEEE float arithmetic

From: Abdulaziz Ghuloum
Subject: [Chicken-users] Re: IEEE float arithmetic
Date: Tue, 20 Jun 2006 20:33:28 -0400
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.12) Gecko/20050915

John Cowan wrote:

Abdulaziz Ghuloum scripsit:

The test [for infinity] is obviously bogus since f==f+1.0 for large values of f.
(try 1e16)

Oops, quite right.

The expression "f != 0.0 && f == f + f" will work, I think.
0.0 and NaN are rejected by the left side of "&&", and all
other finite values by the right side.

Out of curiosity, why not simply do "f==1.0/0.0 || f==-1.0/0.0" to test
if f is +inf.0/-inf.0?


reply via email to

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