开发者

Why does JavaScript Math.log(1.001) return the wrong value?

开发者 https://www.devze.com 2023-02-12 08:38 出处:网络
JavaScript returns .0009995003330834232. Every other way of calculating re开发者_StackOverflowturns 0.000434077479319.It returns the natural logarithm, i.e. the logarithm to base e = 2.71828..., inst

JavaScript returns .0009995003330834232.

Every other way of calculating re开发者_StackOverflowturns 0.000434077479319.


It returns the natural logarithm, i.e. the logarithm to base e = 2.71828..., instead of the logarithm to base 10.

log_e(1.001) = 0.00099950033308342321
log_10(1.001) = 0.0004340774793185929
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号