[Haskell-cafe] Re: 0/0 > 1 == False

Jonathan Cast jonathanccast at fastmail.fm
Mon Jan 14 23:28:25 EST 2008


On 14 Jan 2008, at 9:56 AM, David Roundy wrote:

> On Fri, Jan 11, 2008 at 07:10:20PM -0800, Jonathan Cast wrote:
>> On 11 Jan 2008, at 10:12 AM, Achim Schneider wrote:
>>
>>> David Roundy <droundy at darcs.net> wrote:
>>>
>>>> Prelude> let x=1e-300/1e300
>>>> Prelude> x
>>>> 0.0
>>>> Prelude> x/x
>>>> NaN
>>>>
>>>> The "true" answer here is that x/x == 1.0 (not 0 or +Infinity), but
>>>> there's no way for the computer to know this, so it's NaN.

Ah.  My apologies.  Must remember to read first, then flame...

You are right that, in Ratio Integer, you get this result.  But you  
can't get that answer in Double.

jcc



More information about the Haskell-Cafe mailing list