mosml
mosml copied to clipboard
Real.fromString can raise Overflow on large/small values
Real.fromString may raise Overflow, if presented with too large or too small a value.
Example:
load "Real";
val a = Real.fromString "1e-400";
val b = Real.fromString "1e400";
As far as I can tell, the specification says, that in these cases it should return zero (if too small in magnitude) or infinity (if too large in magnitude).
You are right. Moscow ML unfortunately stray from the definition several places wrt the real type.