Do not use Math.sign().
Merge pull request #1336 from smblott-github/do-not-use-math.sign

Do not use Math.sign().