‘e’ in javascript numbers

4e4 is a floating-point number representation.
It consists of:

  1. Sign – S(+ or -)
  2. Mantissa – M(some number, normalized: 1.x where x is some sequence of digits)
  3. Exponent – E(represents a power of 10 that is Mantissa(M) multiplied with)

It is also a way of how floating-point numbers are stored on the system. For instance, for single-precision we get:
single-precision floating-point number representation

Together, it gives us:

-1^S * M * p^E where p is the basis of the numerical system

So, in common sense, p can be anything so that 4e4 could be also 4 * 5^4 if p == 5

As we usually work with decimal values p is equal to 10

And as was answered before, 4e4 == 4 * 10^4 (as 4 is a decimal value in this case)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)