Commit Graph

4 Commits

Author SHA1 Message Date
Jason Rhinelander
9b2c65fee9 Work around libc++ bug 17782
libc++ fails to extract a valid float/double literal when it is followed
by any special characters that can also be found in a float value,
in this case, f (https://llvm.org/bugs/show_bug.cgi?id=17782).

This commit works around the problem by not putting the "f" suffix into
the string for extraction.
2016-05-03 10:21:02 -04:00
Jason Rhinelander
d02b36e735 Simplify literal conversion tests
The tests are failing under OS X/clang, but it isn't obvious to me why.
This commit simplifies the test code by ignoring the stringstream I/O
status, and reorganizes it to be clearer whether it's the initial
conversion to string that is failing, or the subsequent conversion back
from string.
2016-05-03 10:21:02 -04:00
Kyle Lutz
d15cb3314b Fix sign comparison warning in test_literal_conversion 2016-04-30 09:21:44 -07:00
Jason Rhinelander
7f18293526 Increase make_literal precision
make_literal is losing some precision when making literal floating
point values because it uses digits10, but that only gives us the
number of decimal digits that will survive a decimal->native>decimal
conversion; what we are doing is a native->decimal->native conversion,
which requires the user of ::max_digits10 (which is 2 (double) or 3
(float) larger than ::digits10).

max_digits10 is a c++11 feature, however, so this commit uses
digits10 + 3 when the c++11 numeric_limits isn't available.
2016-04-24 17:32:55 -04:00