Floating-point values can be represented using e-notation.
E-notation indicates a number that should be multiplied by 10 raised to a given power.
integer or floating-point, followed by
than by the power of 10 to multiply by.
Consider the following:
var floatNum = 3.125e7; //equal to 31250000 console.log(floatNum);
In this example, floatNum is equal to 31,250,000. The notation essentially says, "Take 3.125 and multiply it by 10 7."
The code above generates the following result.
E-notation can also be used to represent very small numbers, such as
which can be written more succinctly as