[Haskell-cafe] How odd...
lennart at augustsson.net
Sat Aug 4 13:44:58 EDT 2007
Infinity is a very slippery concept, you can't compute with it like that.
You can compute various limits, though.
So, e.g., for a > 0
lim x*a -> Inf
lim x*0 -> 0
lim x*(1/x) -> 1
And that last one would be "Inf*0" in the limit. In fact, you can make
Inf*0 any number you like. So NaN is the sensible.
On 8/4/07, Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> >> 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.)
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe