MinBound and maxBound return invalid number for Int

Target type with fixed accuracy, at least with the range [-2 ^ 29 .. 2 ^ 29-1]. The exact range for a particular implementation can be determined using minBound and maxBound from the Bounded class.

This came straight from hackage.haskell.org.

According to both hackage.haskell.org and learnyouahaskell.com, I have to get -2147483648 for minBound and 2147483648 for maxBound .

When I run it myself, I get this result:

enter image description here

Sorry if this is a really stupid question. I am new to Haskell and check how everything works.

Am I doing something wrong?

+8
haskell
source share
1 answer

Int guaranteed at least this range. Int on your platform is apparently 64 bits. Compare with 2^63 :

 ghci> 2^63 9223372036854775808 
+12
source share

All Articles