Home My Page Projects Code Snippets Project Openings SML/NJ Bugs
Summary Activity Tracker Lists

[#194] Real.fromString overflows or hangs

Date:
2018-02-14 02:20
Priority:
3
State:
Closed
Submitted by:
Bug Submitter (webuser)
Assigned to:
John Reppy (jhr)
Machine Architecture:
None
Operating System:
Generic Unix
Component:
Basis Library
Resolution:
Fixed
Severity:
Minor
OS Version:
SML/NJ Version:
110.81
Keywords:
reals
URL:
Transcript (of reproduction):
- Real.fromString "1e10000000000"; (* ten zeros *) uncaught exception Overflow [overflow] raised at: <file Basis/Implementation/num-scan.sml> - Real.fromString "1e100000000"; (* eight zeros *) Interrupt
Source (for reproduction):
Real.fromString "1e10000000000"; (* ten zeros *) Real.fromString "1e100000000"; (* eight zeros *)
Summary:
Real.fromString overflows or hangs

Detailed description
When given a large (but syntactically correct) input,
Real.fromString should return (SOME inf). Instead, it
sometimes raises Overflow, or even hangs.

I have observed the problem on both Unix and Windows.

Submitted via web form by Karl Crary <crary@cs.cmu.edu>

Comments:

Message  ↓
Date: 2018-04-12 13:36
Sender: John Reppy

There were two issues here. First, the Overflow exception was coming from scanning the exponent, but it was not being handled. The second problem was that the scaling for large exponents did not terminate once infinity (or zero) was reached, so it would take a long time (it does eventually terminate). These problems have been fixed for 110.83.

Date: 2018-03-01 19:27
Sender: John Reppy

The Basis Library specification states that the result should be infinity in these cases.

Attached Files:

Changes

Field Old Value Date By
status_idOpen2018-04-12 13:36jhr
close_dateNone2018-04-12 13:36jhr
ResolutionAccepted As Bug2018-04-12 13:36jhr
assigned_tonone2018-02-22 19:19jhr
detailsWhen given a large (but syntactically correct) input, Real.fromString should return (SOME inf). Instead, it sometimes raises Overflow, or even hangs. I have observed the problem on both Unix and Windows. Submitted via web form by Karl Crary <crary@cs.cmu.edu> 2018-02-22 19:19jhr
ResolutionNone2018-02-22 19:19jhr
Transcript (of reproduction)- Real.fromString "1e10000000000"; (* ten zeros *) uncaught exception Overflow [overflow] raised at: <file Basis/Implementation/num-scan.sml> - Real.fromString "1e100000000"; (* eight zeros *) Interrupt 2018-02-22 19:19jhr
Source (for reproduction)Real.fromString "1e10000000000"; (* ten zeros *) Real.fromString "1e100000000"; (* eight zeros *) 2018-02-22 19:19jhr