avoid using Math.abs

review comment on - c6f5311
To avoid overflow issues and unnecessary calls to Math.abs.
Merge pull request #471 from metamx/minor-optimization

avoid using Math.abs