26 Apr
2004
26 Apr
'04
4:13 p.m.
Wolfgang Jeltsch <wolfgang@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