Recap of Floating Point Numbers
What We’ve Covered So Far
Floating point number variables (also called floats) are used when you need a number with a decimal point in it.
Declaring a float variable:
1 |
float moo; // declaring a float variable named foo |
Changing a float variable:
1 |
moo = 21.3; |
Declaring and assigning a float variable at the same time:
1 |
float moo = 0.955; // declaring a float named moo with a value of zero point nine five five |