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

Parse doubles with boost::spirit::qi::long_double #435

Merged
merged 1 commit into from
Jun 15, 2016

Conversation

jimhester
Copy link
Collaborator

This works around an unaddressed spirit regression
(https://svn.boost.org/trac/boost/ticket/11608).

Fixes #412

I did some benchmarks and there was no performance regressions when parsing a large file of doubles.

Note the numbers being tested are both representable as regular doubles, the double_ parser is just parsing them improperly.

@hadley
Copy link
Member

hadley commented Jun 15, 2016

LGTM

@defconst
Copy link

real_parser<double, DecimalCommaPolicy> needs also a fix, it has the same problem with large numbers ...

reprex: https://gist.github.com/stdlib/75d90e9bbde3762eb78acc8f5271232d

> ./real_parser 10000000000000000000,00
real_parser<double>
return value: 1
parse result: 1e+19
real_parser<long double>
return value: 1
parse result: 1e+19
> ./real_parser 100000000000000000000,00
real_parser<double>
return value: 0
parse result: -1
real_parser<long double>
return value: 1
parse result: 1e+20

@jimhester jimhester merged commit 9f5c998 into tidyverse:master Jun 15, 2016
@jimhester
Copy link
Collaborator Author

@StdLib thank you for noticing that, now fixed as well.

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

Successfully merging this pull request may close these issues.

3 participants