Help! catching a (1.#QNaN)

Martin Holters martin.holters@gmx.de
Sat, 19 Apr 2003 16:27:21 +0200


> > I would like to catch when my code produce a QNAN "Quiet Not a Number"
> > (I'm working with Float Numbers) . I founded in Prelude Module  the
> > function "IsNaN" but, it doesn't Work. (it returns FALSE in all cases).
> > So, anybody Knows how detect a QNaN in Haskell?
>
> What do you mean, "it doesn't Work"? Can you give an example of short
> Haskell code from which you expect SNaNs and QNaNs so we can try them out
> and play? Which Haskell compiler on which architecture are you using? I
> find that, for example, isNaN (0/0) is True in GHC and False in Hugs on
> Linux, which is mildly surprising - I thought it should always be true?

Try isIEEE 0.0
GHC: True
Hugs: False

Not very satisfying, I think, but it explains the different behaviour for 
isNaN , at least.

cu
Martin