With the caveat that I'm not very fluent in bitwise operators, and I'm not totally sure I can point to the part of the Javascript spec that explains why this fix works, and the left shift operators don't...but it seems like, in Safari at least, 1 << 15.5 == 1 << 15, which is unexpected.
This branch uses Math.pow instead — where (again, in Safari) Math.pow(2, 15.5) != Math.pow(2, 15), which is expected.
With the caveat that I'm not very fluent in bitwise operators, and I'm not totally sure I can point to the part of the Javascript spec that explains why this fix works, and the left shift operators don't...but it seems like, in Safari at least,
1 << 15.5 == 1 << 15
, which is unexpected.This branch uses
Math.pow
instead — where (again, in Safari)Math.pow(2, 15.5) != Math.pow(2, 15)
, which is expected.fixes #171