Help! catching a (1.#QNaN)

Mark Carroll mark@chaos.x-philes.com
Fri, 18 Apr 2003 15:02:39 -0400 (EDT)


On Fri, 18 Apr 2003, Cesar Augusto Acosta Minoli wrote:

> 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=A0 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?

-- Mark