Repository navigation
Extend inverse power of 5 table for Real.fromString - #306
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extend the inverse power of 5 table so that larger negative exponents will not raise a Subscript exception.
Related Issue
Motivation and Context
Real.fromString (Real.toString Real.minPos)raises a Subscript exception. Some codebases like SML.NET parse real constants with SML/NJ'sReal.fromStringfunction, and they implementReal.minPosin their basis library as a constant4.94e~320, so they can't compile with the 2025.1 SML/NJ because that constant goes out of the bounds of the inverse power of 5 table.The
cvtfunction in thefrep-to-real64.smlfile is an implementation ofs2din the ryu codebase. In that repository there is a PR that extends the inverse power of 5 table ulfjack/ryu#237. This PR simply uses the numbers in that PR to extend the table.How Has This Been Tested?
I'm not too familiar with all the numbers that would hit every inverse power of 5 in the extended table, so there is probably missing cases that would need to be tested here.