[Haskell] sizeFM type

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Mon Apr 26 18:13:42 EDT 2004


Wolfgang Jeltsch <wolfgang at jeltsch.net> writes:

> > To ask a silly question, is Int defined as 32 bits or is it defined in a
> > similar vein to C's int?
> 
> I think it is defined to cover at least the numbers from
>     -(2 ^ 27) + 1
> to
>     2 ^ 27 - 1.

Actually, according to section 6.4 of the Report:
      -(2 ^ 29) + 1
  to
      2 ^ 29 - 1.
i.e. a minimum of 30 bits wide.  Also, the Bounded class methods,
maxBound and minBound, can be used to determine the exact Int range
defined in a particular implementation.  (I believe all current
implementations actually use 32 bits.)

Regards,
    Malcolm


More information about the Haskell mailing list