With floating point numbers

I noticed that this code compiles, but I have no idea why:

int main() { double z = 0.000000000000001E-383DD; } 

But I'm not sure what DD means at the end of the number. I looked at the standard, but this was not mentioned.

I got this number from the following command:

 $ gcc -dM -E - < /dev/null #define __DBL_MIN_EXP__ (-1021) #define __FLT_MIN__ 1.17549435e-38F #define __DEC64_DEN__ 0.000000000000001E-383DD ... 

Perhaps this is a GCC extension?

+2
source share
3 answers

Correctly this is aa GCC extension to indicate a 64-bit decimal floating point .

Other extension suffixes:

+7
source

Yes, this is a GCC extension to support decimal float . A literal is of type _Decimal64 , but is converted when a double variable is assigned.

+1
source

Maybe it means a tightly packed Decimal number of 64 bits?

This wikipedia section of the article looks as if it matches the name define, no?

+1
source

Source: https://habr.com/ru/post/924331/


All Articles