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.