[Haskell-cafe] Int vs Integer

Wolfgang Jeltsch wolfgang at jeltsch.net
Mon Dec 19 05:26:54 EST 2005


Am Montag, 19. Dezember 2005 01:10 schrieb Jared Updike:
> Int is for bounded values -2**32 to 2**32 (I think... maybe 2**-31 and
> 2**31 or less if it's boxed?) based on the underlying machine
> representation.

Not really true.  As far as I remember, the Haskell Report just says that Int 
covers at least the integers from -2^27 to 2^27 - 1.  The range for Int can 
be higher than the range just given.  For 32-bit machines it will probably be 
-2^31 to 2^31 - 1 but there's no guarantee for that.

> [...]

>  Jared.

Best wishes,
Wolfgang


More information about the Haskell-Cafe mailing list