Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   hex float literals in C++ (http://www.velocityreviews.com/forums/t459839-hex-float-literals-in-c.html)

John Salmon 01-15-2007 04:09 PM

hex float literals in C++
 

It is widely acknowledged that C++ is moving toward greater
compatibility with C99. Great! Where can I find the details?
I'm particularly interested in support for hexadecimal floating point
constants.

I have found the TR1 document which describes new library features

http://www.open-std.org/jtc1/sc22/wg...2005/n1836.pdf


which describes a new 'hexfloat' manipulator and incorporates by
reference the C99 format conversion specifiers: %a and %A.

But what about literal floats in program text? Will I be able
to write:

float x = 0x1.ap+0;

in a standards conforming C++ program at some point? I can already
do this with some (most?) compilers, but I find myself battling the
"standards compliance police". Is there a draft or a proposal,
or something that I can reference, so at least I can say "This works
with the compilers we're using today, and it is on track to be standardized
in the future, so there's an awfully good chance it will continue to
work for as long as we need it."

Thanks,
John Salmon

mlimber 01-15-2007 07:20 PM

Re: hex float literals in C++
 
John Salmon wrote:
> It is widely acknowledged that C++ is moving toward greater
> compatibility with C99. Great! Where can I find the details?
> I'm particularly interested in support for hexadecimal floating point
> constants.
>
> I have found the TR1 document which describes new library features
>
> http://www.open-std.org/jtc1/sc22/wg...2005/n1836.pdf
>
>
> which describes a new 'hexfloat' manipulator and incorporates by
> reference the C99 format conversion specifiers: %a and %A.
>
> But what about literal floats in program text? Will I be able
> to write:
>
> float x = 0x1.ap+0;
>
> in a standards conforming C++ program at some point? I can already
> do this with some (most?) compilers, but I find myself battling the
> "standards compliance police". Is there a draft or a proposal,
> or something that I can reference, so at least I can say "This works
> with the compilers we're using today, and it is on track to be standardized
> in the future, so there's an awfully good chance it will continue to
> work for as long as we need it."


If you don't get an answer here, you might try on comp.std.c++.

Cheers! --M



All times are GMT. The time now is 03:48 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.