I have some calculation in javascript that includes exponentiation.
Can any of you say why does this sentence return value 1???
alert ((0.03+1)^(271/365)-1);
Thanks
The ^ is actually a bitwise XOR operator. You're looking for Math.pow():
alert(Math.pow((0.03+1), (271/365))-1);
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