I need some help how to make this math formula in javascript. i have tried searching but couldn't really find cause i dont even know what ^ is called in English.
Thanks in advance
Math.floor(20*(1.1^(x-10)));
I need some help how to make this math formula in javascript. i have tried searching but couldn't really find cause i dont even know what ^ is called in English.
Thanks in advance
Math.floor(20*(1.1^(x-10)));
Math.pow()
is what you are looking for.^
, as used in other languages, is called the power or exponential operator, but in Javascript, it serves a different purpose, it is the bitwise XOR operator.^
is the bitwiseXOR
operator - not what you want. Use theMath.pow
function for exponentiation:Set this up in a function so you can use
x
for whatever value it may be: