Velocity Reviews

Velocity Reviews (
-   C Programming (
-   -   Re: OxCp syntax ? (

Nobody 08-28-2012 01:17 PM

Re: OxCp syntax ?
On Tue, 28 Aug 2012 13:28:35 +0200, Guillaume Dargaud wrote:

> I just ran across this syntax:
> #define NAN 0xCp125f
> Can somebody explain ? A quick googling turned out nothing.

It's a hexadecimal floating-point constant (see

"0x" is the hexadecimal prefix.
"C" is the value of the significand (mantissa) in hex, i.e. 12 decimal.
"p" is the binary exponent indicator (binary version of "e").
"125" is the binary exponent in decimal.
"f" is the "float" (single-precision) suffix.

So: 0xCp125f is 12*2^125 ~= 5.104e+38.

All times are GMT. The time now is 03:59 PM.

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