Opened 7 years ago
Closed 3 years ago
#11608 closed Bugs (fixed)
boost::spirit::double_ fails with large numbers
Reported by: | Owned by: | Joel de Guzman | |
---|---|---|---|
Milestone: | To Be Determined | Component: | spirit |
Version: | Boost 1.59.0 | Severity: | Regression |
Keywords: | Cc: |
Description
Since 1.59.0, spirit fails to parse large doubles when they are written out.
#include <boost/spirit/include/qi_real.hpp> #include <iostream> int main() { // 2^100, exactly representable as double auto str = "1267650600228229401496703205376"; double f; boost::spirit::qi::parse(str, str + strlen(str), boost::spirit::double_, f); // The following code line prints // 1.26765e+30 (with boost 1.58.0, correct) // -9.25596e+61 (with boost 1.59.0) std::cout << f << std::endl; return 0; }
Change History (6)
comment:1 by , 7 years ago
Component: | None → spirit |
---|---|
Owner: | set to |
comment:2 by , 7 years ago
Summary: | boost::spirit::double_ yields wrong result → boost::spirit::double_ yields fails with large numbers |
---|
comment:3 by , 7 years ago
Summary: | boost::spirit::double_ yields fails with large numbers → boost::spirit::double_ fails with large numbers |
---|
comment:5 by , 3 years ago
Fixed in https://github.com/boostorg/spirit/commit/be7640bd692684b2fd7532745ddd6343e551744d tests added
comment:6 by , 3 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Actually the line
returns false with boost 1.59.0. So it does not "yield a wrong result" but fails, and I have updated the summary accordingly.
It is still a regression.