This article says:
If I write a line of code like this inside a function:
return 1.4
, It is obvious to both me and the compiler that the function is returning a double.
It is not obvious to me: the return type could be a float, a double, or a long double. How does the compiler choose between the 3 types?
No, 1.4
is a double
. float
is written as 1.4f
75 // int
75u // unsigned int
75l // long
75ul // unsigned long
75lu // unsigned long
3.14159L // long double
6.02e23f // float
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With