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

Achim Schneider barsoap at web.de
Fri Jan 11 08:54:20 EST 2008


Ketil Malde <ketil+haskell at ii.uib.no> wrote:

> Achim Schneider <barsoap at web.de> writes:
> 
> >> You need to use the / operator, if you want to do floating-point
> >> division.
> 
> > Yes, exactly, integers don't have +-0 and +-infinity... only
> > (obviously) a kind of nan.
> 
> No, failure (exception, bottom) is different from NaN, which is just
> another value in the domain - admittedly one which behaves rather
> strangely.
> 
s/a kind of/not entirely unlike a/

> > Said differently: I don't know a thing about floats or numerics.
> 
> Perhaps it helps to think of floating point values as intervals? If +0
> means some number between 0 and the next possible representable
> number (and similar for -0), it may make more sense to have 1/+0 and
> 1/-0 behave differently.  
> 
Hmmm... ah.

+-0 / +-0 is always NaN 'cos you can't tell which one is bigger and
thus can't decide between positive and negative Infinity, and it
isn't both, either.

But then there's +0/0 and -0/0, which would be +Infinity and
-Infinity, and +0 > 0 > -0. AFAIK there are no floats with three zero
values, though. 


-- 
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All rights reserved. Unauthorised copying,
hiring, renting, public performance and/or broadcasting of this
signature prohibited. 



More information about the Haskell-Cafe mailing list