Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string to float not roundtrip for float32 #18148

Closed
timotheecour opened this issue Jun 2, 2021 · 0 comments
Closed

string to float not roundtrip for float32 #18148

timotheecour opened this issue Jun 2, 2021 · 0 comments

Comments

@timotheecour
Copy link
Member

timotheecour commented Jun 2, 2021

now that dragonbox was merged, string to float is roundtrip for float64, but not for float32;
even though dragonbox algorithm can handle it, the one that was ported (dragonbox.cc) only handles float64 (and conversion from float32 to float64 doesn't make it roundtrip)

Example

var a = 1.1'f32
doAssert $a == "1.1", $a # fails

Current Output

assert fails

Expected Output

works

Possible Solution

port or wrap https://github.com/abolz/Drachennest/blob/master/src/schubfach_32.cc, as explained in #18139 (comment), #18008 (comment) as i did via wrapping in timotheecour#732

Additional Information

1.5.1 63db2b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants