[Haskell-cafe] Error handling in calculations

hjgtuyl at chello.nl hjgtuyl at chello.nl
Wed Mar 19 16:47:52 EDT 2008


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.

-- 
Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://functor.bamikanarie.com
http://Van.Tuyl.eu/
--



More information about the Haskell-Cafe mailing list