[Bug 873385] Random module fails on Doubles because of odd minBound behaviour

bugzilla at redhat.com bugzilla at redhat.com
Wed Jan 7 06:55:17 UTC 2015


https://bugzilla.redhat.com/show_bug.cgi?id=873385



--- Comment #5 from Jens Petersen <petersen at redhat.com> ---
(FWIW 64bit ghci gives:

Prelude> toInteger (minBound :: Int)
-9223372036854775808
)

Hugs seems to be assuming Int32, but something is indeed going
wildly wrong with "toInteger (minBound::Int)".

I looked at:

src/bignums.c:326:primFun(primIntToInteger) {        /* Conversion :: Int ->
Integer       */

but I am not familiar with hugs' internals and things
seems to get into deep water quickly.


BTW "toInteger (minBound + 1:: Int) -1"
and "toInteger (minBound -1:: Int) +1"
seem to give the expected answer.

I almost wonder if it would be better to drop 64bit arch build for hugs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=rjJucSi9ve&a=cc_unsubscribe


More information about the haskell-devel mailing list