> No, The issue is that '/' is always floating point division in haskell, > for integer division, use `div`. > > 1 `div` 0 throws an exception like you expect. > > GHC behaves exactly the same as C here. But in C whether '/' means > floating point or integral division depends on the types of its > arguments, in haskell they are separate operators.
Aha, I was missing something. Indeed, 1.0/0.0 gives me infinity with C. Thanks for the clarification. Python does throw for 1.0/0.0, but I think there's a (not very commonly used) module to turn that off. It might be nice for GHC to have a some way to turn exceptions on, but I can accept getting NaNs, and doing the ieee754 thing by default seems entirely reasonable. But what about that NaN->Integer conversion thing? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe