What's the opposite of JavaScript's Math.pow?

南楼画角 提交于 2019-11-27 02:11:32

问题


I'm having a mental block here, and algebra not really being my thing, can you tell me how to re-write the JavaScript code below to derive the variable, c, in terms of a and b?:

a = Math.pow(b, c);
c = ?

Thanks!


回答1:


c = Math.log(a)/Math.log(b)



回答2:


Logarithms. You want the logarithm of a. B is the base, c is the exponent, so

logb a = c



来源:https://stackoverflow.com/questions/4016213/whats-the-opposite-of-javascripts-math-pow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!