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

Cristian Baboi cristi at ot.onrc.ro
Thu Jan 10 03:45:58 EST 2008


On Thu, 10 Jan 2008 10:22:03 +0200, Mitar <mmitar at gmail.com> wrote:

> Hi!
>
> Why is 0/0 (which is NaN) > 1 == False and at the same time 0/0 < 1 ==
> False. This means that 0/0 == 1? No, because also 0/0 == 1 == False.
>
> I understand that proper mathematical behavior would be that as 0/0 is
> mathematically undefined that 0/0 cannot be even compared to 1.
>
> There is probably an implementation reason behind it, but do we really
> want such "hidden" behavior? Would not it be better to throw some kind
> of an error?
>
>
> Mitar

I think it's a bug.
Here is why:

let f = (\x -> x/0) in f 0 == f 0

Referential transparency say that f 0 must equal to f 0, but in this case  
it is not. :-)





________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Servers.
  part000.txt - is OK
http://www.eset.com


More information about the Haskell-Cafe mailing list