<br><div><span class="gmail_quote">On 9/29/05, <b class="gmail_sendername">Yitzchak Gale</b> &lt;<a href="mailto:gale@sefer.org">gale@sefer.org</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
While checking for floating-point overflow and<br>underflow conditions, I tried to create a somewhat<br>reliable cross-platform Infinity with the literal<br>&quot;1e100000&quot;.<br><br>When GHC 6.4.1 reads this literal, it goes into a
<br>deep trance and consumes huge amounts of<br>memory. Shouldn't it immediately recognize such a<br>thing as Infinity?</blockquote><div><br>
I think it is equivalent to (fromRational 1e100000), and (1e100000 :: Rational)<br>
can take a substantial amount of space. <br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Is there a better way to check for Infinity?&nbsp;&nbsp;I<br>have not yet figured out how to check for NaN at
<br>all - because it is not equal to itself. Any<br>suggestions?</blockquote><div><br>
Did you try isNaN and isInfinite? I don't have much experience with these functions myself.<br>
</div><br>Best regards<br>
Tomasz<br>
</div><br>