Re: [q-lang-users] [Chicken-users] Re: IEEE float arithmetic
Brought to you by:
agraef
From: Thomas C. <ch...@we...> - 2006-06-22 12:02:21
|
On Wed, 21 Jun 2006, John Cowan wrote: > Abdulaziz Ghuloum scripsit: > >> 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? > > Umm. Too obvious, I guess. I started working these out in > Chicken, where dividing by zero throws an exception, so I > wanted some other method. But in C, of course, there's no > such issue. [...] Hello, are you sure this works on every architecture? I dimly recall having seen systems where NaN != NaN holds, so you have to use the isnan predicate function from the C math library... cu, Thomas |