Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++: difference between 0. and 0.0?

I am well aware of the difference between 0 and 0.0 (int and double).

But is there any difference between 0. and 0.0 ( please note the . )?

Thanks a lot in advance,

Axel

like image 923
user541747 Avatar asked Mar 12 '26 14:03

user541747


1 Answers

There is no difference. Both literals are double. From the C++-Grammar:

fractional-constant:
    digit-sequenceopt . digit-sequence
    digit-sequence .

See: Hyperlinked C++ BNF Grammar

like image 156
Marcus Borkenhagen Avatar answered Mar 14 '26 05:03

Marcus Borkenhagen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!