Difference between e and E in scientific notation

∥☆過路亽.° 提交于 2019-12-24 16:35:22

问题


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")


回答1:


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.



来源:https://stackoverflow.com/questions/21216316/difference-between-e-and-e-in-scientific-notation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!