* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-03-19 21:47:52+0100]
>
> L.S.,
>
> When playing with exceptions, I noticed the following strangeness:
>   *Main> 1 / 0
>   Infinity
>   *Main> 1 `div` 0
>   *** Exception: divide by zero
>
> This is in GHCi 6.8.2; WinHugs Sep 2006 gives:
>   Main> 1 / 0
>   1.#INF
>   Main> 1 `div` 0
>
>   Program error: divide by zero
>
> Is this difference between fractional and integral calculation  
> intentional? It makes error handling more difficult.

I think it's because in the first case you have floating-point overflow
(which can happen not just in case of division by 0 and means some
very-large number -- remember, you cannot distinguish 0 and 0.00..001)
and in the second case it's just division by zero -- meaningless
operation.

-- 
Roman I. Cheplyaka :: http://ro-che.info/
...being in love is totally punk rock...

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to