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!
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!
c = Math.log(a)/Math.log(b)
let power = Math.round( Math.log(value) / Math.log(2) );
should be accurate in my case? –
Incarcerate Logarithms. You want the logarithm of a. B is the base, c is the exponent, so
logb a = c
© 2022 - 2024 — McMap. All rights reserved.