c - Defining floating point values by base and exponent explicitly -



c - Defining floating point values by base and exponent explicitly -

i stumbled upon http://sourceware.org/ml/glibc-cvs/2013-q1/msg00115.html, includes line

#define two5 0x1.0p5 /* 2^5 */

apparently, two5 defined double explicit value 1<<5. however, first time see notation. how has format been in use, , advantage on writing 2.5?

this notation introduced in c99. advantage value expressed in hexadecimal form, not subject rounding etc. occurs when convert floating-point value between underlying representation , decimal form.

there plenty of pages describe notation, example:

http://www.exploringbinary.com/hexadecimal-floating-point-constants/

c floating-point notation

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -