Fix proposal for issue 1

Small negative differences were causing an infinite loop.
Because the rounded value was 0, but when checking for negativity
we used the original negative value.
Merge pull request #2 from raphaelmor/issue1

Fix proposal for issue 1