与JS Math.log()等效的Excel日志 [英] Excel log equivilent to JS Math.log()
问题描述
在我的JavaScript代码中,我有以下内容
In my javascript code I have the following
Math.log(20) = 2.995732273553991
在我的excel公式中,我尝试使用
In my excel formula I try to replicate this with
=LOG(20) = 1.301029996
任何人都知道为什么我会得到两种不同的结果吗?我希望我的Excel能够匹配我的js.
Anyone have any idea why I'm getting two different outcomes? I'd like my excel to match my js.
推荐答案
Math.log(20)以e为底,而LOG(20)以10为底.
Math.log(20) is base e, while LOG(20) is base 10.
您不是要查找LOG(20),而是要查找LN(20)(基于e).
You're not looking for LOG(20), but probably rather LN(20) (base e).
MDN(用于javascript): https ://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Math/log
MDN (for javascript) : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/log
LN(用于excel): https://support.office.com/zh-CN/article/LN-function-81fe1ed7-dac9-4acd-ba1d-07a142c6118f
LN (for excel): https://support.office.com/en-us/article/LN-function-81fe1ed7-dac9-4acd-ba1d-07a142c6118f
您使用的LOG Function如果未设置第二个参数,则会自动将其设置为10(默认值为10),如此处指出:
The LOG Function you are using automatically set the second parameter to 10 if it is not set (default 10), as pointed out there:
从此处: https: //support.office.com/zh-CN/article/LOG-function-4e82f196-1ca9-4747-8fb0-6c4a3abb3280
这篇关于与JS Math.log()等效的Excel日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!