Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Don't compare floating point numbers for exact equality #1851

merged 1 commit into from Mar 12, 2014


None yet
2 participants

twpayne commented Mar 12, 2014

A couple of the tests added in #1746 compared floating point numbers for exact equality. On my browser (Chrome 33 on Mac OS X) the results aren't quite the same, e.g.:

Error: expected 14.849242404917495 to equal 14.849242404917458
Error: expected 4585.786437626903 to equal 4585.78643762691

This PR uses roughlyEqual to add a small tolerance to the tests.


fredj commented Mar 12, 2014


twpayne added a commit that referenced this pull request Mar 12, 2014

Merge pull request #1851 from twpayne/looser-tests
Don't compare floating point numbers for exact equality

@twpayne twpayne merged commit f60891a into openlayers:master Mar 12, 2014

1 check passed

default The Travis CI build passed

@twpayne twpayne deleted the twpayne:looser-tests branch Mar 12, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment