Why does JavaScript Math.log(1.001) return the wrong value?
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
精彩评论