GHC and Haskell Standard wrt floatRange...
Tyson Whitehead
twhitehead at gmail.com
Mon Mar 9 17:14:12 EDT 2009
I think there might be a difference between C/GHC and the Haskell Standard's
idea of the range of the exponential. Specifically, the comment in gcc's
float.h (i.e., where GHC appears to gets its definition from) says
/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
while the Haskell Standard says
"...the lowest and highest values the exponent may assume respectively..."
This results in (GHC 6.10.1 on Debian)
Prelude> (2**128::Float)
Infinity
Prelude> (2**127::Float)
1.7014119e38
Prelude> floatRange (0::Float)
(-125,128)
I can file a bug report/patch if nobody is seeing something I missed here...
Cheers! -Tyson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20090309/db1fcd33/attachment.bin
More information about the Glasgow-haskell-users
mailing list