Bug in real_parser
peterkochlarsen <[email protected]>
| Newsgroups | gmane.comp.parsers.spirit.general |
|---|---|
| Message-ID | <[email protected]> |
There is a bug in real_parser, as an "ignored" exponent gives a wrong result.
Consider
double as_double(std::string const& s)
{
double result;
auto begin = std::begin(s);
if (phrase_parse(begin,std::end(s),double_,space,d)) return -1;
return d;
}
Now as_double("045.000W") returns 45, but as_double("045.000E") returns
45000.
--
View this message in context: http://boost.2283326.n4.nabble.com/Bug-in-real-parser-tp4688120.html
Sent from the spirit-general mailing list archive at Nabble.com.
------------------------------------------------------------------------------