The consensus is that this is a bug.
---------------------- Forwarded by Dominic Steinitz/HEATHROW/BRITISH AIRWAYS/GB on 
16/05/2001 13:48 ---------------------------


[EMAIL PROTECTED] on 16/05/2001 11:54:00
To:     haskell
cc:     
bcc:    Dominic Steinitz
Subject:        Re: Integers to Ints

Hello,

>Can someone explain the following behaviour? Or is it a bug in hugs?

I can not explain it. Rather strange is that even this is allowed:
(fromIntegral (toInteger (minBound::Int) + 1) -1) :: Int
yielding
-2147483648

> > (fromIntegral(toInteger(minBound::Int))::Int)
>
>Program error: {primIntegerToInt (-2147483648)}
>(15 reductions, 70 cells)
>
> > (fromIntegral(toInteger((minBound::Int)+1))::Int)
>-2147483647
>(21 reductions, 29 cells)
>
> > minBound::Int
>-2147483648
>(9 reductions, 19 cells)


_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell



-------------------------------------------------------------------------------------------------
21st century air travel     http://www.britishairways.com

_______________________________________________
Hugs-Bugs mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/hugs-bugs

Reply via email to