How to use scientific notation in js?

前端 未结 3 356
萌比男神i
萌比男神i 2021-01-18 17:45
var a = 5.0;
var b = a * 10e-12;
b *= 10e+12
print(b)

Why b equals 500 instead of 5?

As far as I know 10^(-12) equals to 1/(10^12), how can

3条回答
  •  旧巷少年郎
    2021-01-18 18:43

    "As far as I know 10^(-12) equals to 1/(10^12)" -- that is correct, but 10e-12 actually means 10*10^(-12)

提交回复
热议问题