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!
A logarithm is the opposite of a power. In other words, if we take a logarithm of a number, we undo an exponentiation. Let's start with simple example.
The expression math:pow(-2, -3) returns -0.125e0 .
The method calculates multiplication of the base with itself exponent times and returns the result of type double .
The Math. pow() function returns the base to the exponent power, as in base exponent , the base and the exponent are in decimal numeral system.
c = Math.log(a)/Math.log(b)
Logarithms. You want the logarithm of a. B is the base, c is the exponent, so
logb a = c
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With