简体   繁体   English

使用JavaScript Math.pow for Excel公式

[英]Using JavaScript Math.pow for Excel formula

In Excel I have this equation: 在Excel中,我有以下等式:

=(P12/P10)^(1/P13)-1

I would have thought this equates to: 我以为这等于:

Math.pow( ( P12 / P10 ), (1 / P13 ) ) - 1

I appear to be wrong. 我似乎是错的。

The official order of operations for Excel from Microsoft support seems to agree that those two should be equivalent. Microsoft支持的 Excel的正式操作顺序似乎同意这两个等效。

In Excel I test with 27 in P12, 3 in P10 and 2 in P13, the formula evaluates to 2 在Excel I中,在P12中测试27,在P10中测试3,在P13中测试2,公式的计算结果为2

In javascript I test Math.pow((27/3),(1/2))-1 which also evaluates to 2 在javascript中,我测试了Math.pow((27/3),(1/2))-1,它的计算结果为2

Should work according to this . 应根据工作

Are you missing something? 你想念什么吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM