Bounded and floating types

Stefan O'Rear stefanor at cox.net
Wed Dec 5 20:44:36 EST 2007


On Wed, Dec 05, 2007 at 09:18:38AM +0100, Ketil Malde wrote:
> Stefan O'Rear <stefanor at cox.net> writes:
> 
> > It's rather worse than that.
> >
> > Prelude> let nan = 0/0
> > Prelude> nan > nan
> > False
> > Prelude> nan < nan
> > False
> > Prelude> nan == nan
> > False
> 
> And this begs the question:
> 
>   Prelude> compare nan nan
>   GT
> 
> So while NaN is greater than itself, it is at the same time not
> greater than itself?

There is a case to be made for Ord Double to use the trapping comparison
operators.

Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/libraries/attachments/20071205/d63b9d16/attachment.bin


More information about the Libraries mailing list