Reputation: 571
A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using minBound and maxBound from the Bounded class.
This came straight from hackage.haskell.org.
According to both hackage.haskell.org and learnyouahaskell.com, what I'm supposed to get is -2147483648
for minBound
and 2147483648
for maxBound
.
When I actually run it myself, I get this result :
Apologies if this is a really stupid question. I'm new to Haskell and was testing around to see how things worked.
Am I doing something wrong?
Upvotes: 8
Views: 366
Reputation: 60463
Int
s are only guaranteed to have at least that range. Int
s on your platform appear to be 64 bits. Compare with 2^63
:
ghci> 2^63
9223372036854775808
Upvotes: 12