esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
804 stars 159 forks source link

Comparing floating point numbers in tests : comparing difference instead of using == #516

Open pgrt opened 2 years ago

pgrt commented 2 years ago

Hello,

In the hypervolume tests, some double are compared using ==, which can lead to test failures as it is safer to compare them by checking that their difference is small. In the attached patch I changed some of these tests so that the failing tests now pass, but there remains some other such tests to change I think.

Best, Pierre

check_equality_floating.txt