Math.sign() unavailable fix