[英]what is the difference between Math.E and e
So if I run 所以如果我跑步
System.out.println(1e+0);
it outputs 1 它输出1
however if i run 但是如果我跑
System.out.println(Math.E);
it outputs 2.718......... 它输出2.718 .........
for the life of me I cant figure out how the little e interacts with numbers I get that Math.E is a constant that has something to do with logarithms but I thought the little e was just that being represented in a number yet the code is showing me something different. 在我的一生中,我无法弄清楚小e与数字如何相互作用,我得到Math.E是一个与对数有关的常数,但我认为小e只是以数字表示,而代码却是向我展示一些不同的东西。 can anyone explain how that e interacts with numbers in java?
谁能解释e如何与Java中的数字进行交互?
The literal 1e+0
is scientific notation for 1 * 10⁰
, and 10⁰
being 1
this gives 1 * 1
, thus 1
. 字面量
1e+0
是1 * 10⁰
scientific的科学计数法 ,而10⁰
是1
则得出1 * 1
,即1
。
The constant Math.E
is Euler's Number . 常数
Math.E
是欧拉数 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.