
David Roundy
On Thu, Jan 10, 2008 at 09:41:53PM +0100, Achim Schneider wrote:
David Roundy
wrote: On Thu, Jan 10, 2008 at 09:24:34PM +0100, Achim Schneider wrote:
John Meacham
wrote: 1/0 = Infinity -1/0 = -Infinity
Just out of curiosity:
1/-0 = -Infinity? -1/-0 = Infinity?
Yes. (You could have tried this for yourself, you know... but I suppose haskell-cafe isn't a bad interactive Haskell interpreter, perhaps more user friendly than ghci.)
Prelude> 1 `div` 0 *** Exception: divide by zero
That's it. One just shouldn't just extrapolate and think you didn't mean GHC but IEEE...
Prelude> 1/(-0) -Infinity
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. It's just that with the stuff I do I know I have some logical problem in my formulas when I get any special floating point value anywhere, and using --excess-precision can only make the numbers more precise. Said differently: I don't know a thing about floats or numerics. -- (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.