im using chrome with this code:
var startbet = 1;
var shot = 0;
var bet = startbet * 2^shot;
n^0=n in this case
it should be equal to 1 regardless of n
is this an error with javascript or do some people beleive to the power of 0 should be handled diffrently?
In Javascript, the ^
operator is bitwise XOR, not exponent.
As Mikhail says, you have to use Math.pow() to compute exponents.
I think you need to use Math.pow instead
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