Skip to content

Integer arithmetic gives the wrong answer on amd64/Linux

On x86 I get:

Prelude> reverse $ take 10 $ reverse $ show $ sum [ x ^ x | x <- [1..1000] ]
"9110846700"

which is correct, but on amd64/Linux I get:

Prelude> reverse $ take 10 $ reverse $ show $ sum [ x ^ x | x <- [1..1000] ]
"0612504812"

Both ghci's above are 6.4.1, but I also see it with the HEAD (a few days old).

Seen on Debian, Gentoo and rpath distributions.

Thanks Ian

Trac metadata
Trac field Value
Version 6.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information