Hi,
there's difference in behaviour of how Integers are coerced Ints
between Hugs(98) and ghc.
Prelude> (0x80000000 :: Int)
Program error: {primIntegerToInt 2147483648}
Prelude> (maxBound::Int) + 1
-2147483648
Prelude>
ghc's conversion of Integers is modulo maxInt, i.e.,
(maxBound :: Int) + 1 == (0x80000000::Int)
is True.
That's consistent & handy, but whatever the behaviour used, it'd be
oh-so convenient if the two implementations agreed.
--sigbjorn
- Re: Integer -> Int conversion Sigbjorn Finne (Intl Vendor)
- Re: Integer -> Int conversion Andy Gill
- RE: Integer -> Int conversion Sigbjorn Finne (Intl Vendor)
- Re: Integer -> Int conversion Marc van Dongen
- RE: Integer -> Int conversion Simon Marlow
- Re: Integer -> Int conversion Lennart Augustsson
- Re: Integer -> Int conversion Lennart Augustsson
- RE: Integer -> Int conversion Simon Marlow
