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
Make double parsing locale independent (and faster) #1993
base: master
Are you sure you want to change the base?
Make double parsing locale independent (and faster) #1993
Conversation
|
|
According to https://github.com/fastfloat/fast_float their implementation is now part of gcc (12) and llvm (not sure exactly what version) |
Ok, nice. That was the implementation I was using. I think clang 15 supports it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks!
- use `std::from_chars` instead of `strtod` to parse doubles if available (c++17 required) - otherwise falls back to previous `strtod` implementation - `std::from_chars` is locale independent and faster than `strtod` - add more double parsing tests - add double parsing google benchmarks - resolves symengine#1566
…g comes from parser and will always be parsable to a double
89ee5c8
to
9c09875
Compare
… to incomplete standard library implementations
So it seems that just checking for c++17 at compile time was not sufficient as standard library support for
I've switched to just directly bundling and using the |
std::from_chars
instead ofstrtod
to parse doubles if available (c++17 required)strtod
implementationstd::from_chars
is locale independent and faster thanstrtod