On 9/29/05, Yitzchak Gale <[EMAIL PROTECTED]> wrote:
While checking for floating-point overflow and
underflow conditions, I tried to create a somewhat
reliable cross-platform Infinity with the literal
"1e100000".

When GHC 6.4.1 reads this literal, it goes into a
deep trance and consumes huge amounts of
memory. Shouldn't it immediately recognize such a
thing as Infinity?

I think it is equivalent to (fromRational 1e100000), and (1e100000 :: Rational)
can take a substantial amount of space.

Is there a better way to check for Infinity?  I
have not yet figured out how to check for NaN at
all - because it is not equal to itself. Any
suggestions?

Did you try isNaN and isInfinite? I don't have much experience with these functions myself.

Best regards
Tomasz

_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to