Question

What is the difference in PHP between a value that prints as -9.838335106976932e18 and one that prints as -9.838335106976932E+18? (note the "e18" vs "E+18")

Was it helpful?

Solution

Absolutely no difference. Those are two different conventions in printing a number in scientific notation. Specifically:

  • the E can be either lower or upper case. The former is printed with format string %e, the latter (which is less common), with format string %E.
  • the + before exponent (and/or base) can be omitted.

Regarding the first point, maybe those two values are printed using different format strings, but without code, it is hard to tell.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top