Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix denormals and precision issues in num parser
With the original method we had problems with handling denomals (so e.g. 5e-324 ended up as 0e0) and had precision issues where NOT the closest representable num was generated for a given string, which causes value drift in repeated num->str roundtripping. Fix by extracting essential elements (sign, dot, 'e') and de-Unicodified digits into a string buffer and then letting strtod() handle the dirty work for us. This is likely not the bestest-and-fastest way to do this and currently results in 80% slower parsing of NQP nums. Don't want to do anything fancy in this commit as we're likely going to ship this in a Rakudo/Rakudo Star release right away.
- Loading branch information
1 parent
337cf38
commit c6c0bab
Showing
1 changed file
with
42 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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