October 2011
Beginner to intermediate
1200 pages
35h 33m
English
When you write a floating-point constant in a program, in which floating-point type does the program store it? By default, floating-point constants such as 8.24 and 2.4E8 are type double. If you want a constant to be type float, you use an f or F suffix. For type long double, you use an l or L suffix. (Because the lowercase l looks a lot like the digit 1, the uppercase L is a better choice.) Here are some samples:
1.234f // a float constant2.45E20F // a float constant2.345324E28 // a double constant2.2L // a long double constant
Read now
Unlock full access