[Haskell-cafe] How odd...

Andrew Coppin andrewcoppin at btinternet.com
Sat Aug 4 13:26:15 EDT 2007

>> Um... why would infinity * 0 be NaN? That doesn't make sense...
> Infinity times anything is Infinity.  Zero times anything is zero.  So 
> what should Infinity * zero be?  There isn't one right answer.  In 
> this case the "morally correct" answer is zero, but in other contexts 
> it might be Infinity or even some finite number other than zero.

I don't follow.

Infinity times any positive quantity gives positive infinity.
Infinity times any negative quantity gives negative infinity.
Infinity times zero gives zero.

What's the problem?

> Consider 0.0 / 0.0, which also evaluates to NaN.

Division by zero is *definitely* undefined. (The equation 0 * k = v has 
no solutions.)

More information about the Haskell-Cafe mailing list