mosml icon indicating copy to clipboard operation
mosml copied to clipboard

Real.fromString can raise Overflow on large/small values

Open Eckankar opened this issue 14 years ago • 1 comments

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).

Eckankar avatar Apr 09 '11 19:04 Eckankar

You are right. Moscow ML unfortunately stray from the definition several places wrt the real type.

kfl avatar Apr 14 '11 07:04 kfl