Change default # of digits for APFloat::toString
authorEli Friedman <eli.friedman@gmail.com>
Thu, 29 Aug 2013 23:44:34 +0000 (23:44 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 29 Aug 2013 23:44:34 +0000 (23:44 +0000)
commit1053a0b9b4e0a4f459667c110f40f5314c30f2db
tree2a03ae0ad689506361a95b1a783f76003dcb74ce
parent3a0e9b50f3a9031217a8fe209398ec37c54774eb
Change default # of digits for APFloat::toString

This is a re-commit of r189442; I'll follow up with clang changes.

The previous default was almost, but not quite enough digits to
represent a floating-point value in a manner which preserves the
representation when it's read back in.  The larger default is much
less confusing.

I spent some time looking into printing exactly the right number of
digits if a precision isn't specified, but it's kind of complicated,
and I'm not really sure I understand what APFloat::toString is supposed
to output for FormatPrecision != 0 (or maybe the current API specification
is just silly, not sure which).  I have a WIP patch if anyone is interested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189624 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/APFloat.cpp
unittests/ADT/APFloatTest.cpp