A Floating Point Number is a way to represent a precise number on a computer system. The "floating point" refers to the decimal point. Other than this it is very similar to scientific notation. Using this sort of notation when storing numbers in the computer lets you work with more accuracy and lose less digits than you might have otherwise lost. That being said, be careful of how PHP rounds numbers. You may want to use ceil ()
or floor ()
to choose if you will round up or down.
Also Known As: floats, doubles, real number
$a = 1.234;
$b = 1.2e3;
$c = 7E-10;