[PATCH v2] libstdc++: Add hexfloat/defaultfloat io manipulators.

Jonathan Wakely jwakely@redhat.com
Mon Oct 6 15:56:00 GMT 2014


On 28/03/14 08:56 +0900, Luke Allardyce wrote:
>It looks like the new standard also requires the precision to be
>ignored for hexfloat
>
>>For conversion from a floating-point type, if floatfield != (ios_base::fixed | ios_base:: scientific), str.precision() is specified as precision in the conversion specification. Otherwise, no precision is specified.

I've made this change and adjusted the test so that it doesn't make
any assumptions about the exact format of hexadecimal float output, as
it's unspecified whether you get e.g. 0x1.ep+3 or 0xfp+0 for 15.

As Luke pointed out, this changes the behaviour of some valid C++03
programs, but I think that's the right thing to do in this case. I'll
document that in the release notes.

Tested x86_64-linux, committed to trunk.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 7635 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20141006/ea715c85/attachment.bin>


More information about the Gcc-patches mailing list