Vesa Karvonen wrote:
The type of Real.fromDecimal
Poly/ML 5.1 Testing
Real.fromDecimal ;
val it = fn : IEEEReal.decimal_approx -> Real.real
disagrees with the Basis Library specification (http://www.standardml.org/Basis/real.html#SIG:REAL.toDecimal:VAL)
I've fixed this (in CVS) to return the option type rather than raise an exception. I've also taken a closer look at the string to real conversion functions and made a few changes to bring it in line with the current version of the basis library. In particular they no longer raise exceptions if they overflow or underflow but instead generate signed infinities or zeros. This has the consequence that real constants in ML code are also silently converted to zeros or infinities if they underflow or overflow. It might be better to have a warning message in that case but given the way the conversion process is handled that's difficult to achieve. To be honest the real number handling in Poly/ML would benefit from being looked at by someone who fully understands IEEE arithmetic.
David.