Re: Straightforward conversion from Int <-> Word

26 Feb
2002
26 Feb
'02
9:52 a.m.
Simon Marlow notes:
But fromIntegral *does* do the right thing, doesn't it?
Numeric.showHex (fromIntegral (-1 :: Int32) :: Word32) "" "0xffffffff"
Interesting. The fact that this fooled Julian as well as me suggests the behavior needs to be better documented. Interestingly, hugs yields an error. I'm going to follow up in more detail to haskell, as this is really about the behavior of "fromInteger", and has nothing to do with Word32 or Int32 per se at all. -Jan
8487
Age (days ago)
8487
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jan-Willem Maessen