11 Jun 2007 14:11
[Hugs] #74: Data.Word64: arithmetic overflow when evaluating maxBound + 1
Hugs <trac <at> galois.com>
2007-06-11 12:11:28 GMT
2007-06-11 12:11:28 GMT
#74: Data.Word64: arithmetic overflow when evaluating maxBound + 1
---------------------------------------------------+------------------------
Reporter: guest | Owner: nobody
Type: defect | Status: new
Priority: major | Milestone:
Component: hugs | Version: 200609
Keywords: Data.Word.Word64, arithmetic overflow |
---------------------------------------------------+------------------------
The function (fromInteger x) in Num(Data.Word.Word64) causes a program
error, if x is greater or equal 2^64^. This is particularly annoying when
two valid Word64 variables are to be multiplied.
Take for instance
{{{
Data.Word> maxbound :: Word64
18446744073709551615
Data.Word> 2*(2^63) :: Word64
Program error: arithmetic overflow
Data.Word> (2^64) :: Word64
Program error: arithmetic overflow
}}}
GHC and GHCi return values mod 2^64^, as Hugs does also for Word32 and
2^32^.
--
Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/74>
(Continue reading)
RSS Feed