简体   繁体   中英

Excel Formula to JavaScript Conversion

I have the following formula in Excel

=1-(B30^(EXP(D30-C30)))

where B30, D30 and C30 are cells.

I am converting it into JavaScript something like this

result = 1 - (Math.pow(Math.exp(D30-C30), B30));
console.log(result);

The result is different in JavaScript output, with the exact same input values. If anyone please pointout what is wrong?

Math.powbase应该是第一个参数:

result = 1 - (Math.pow(B30, Math.exp(D30-C30)));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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