-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use tolerance to compare floating point numbers in testGenVector.cxx #498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The exact comparison fails in some architectures where rounding may occur.
|
Hi @amadio, nice pinpointing of the error. I wonder if it wouldn't be better to increase the threshold for 32bits builds only rather than increasing it for 64bits too in order to leave the test as it was where it succeded. |
|
Hi @dpiparo, right above, the test for Point is done like this, so I wouldn't worry about changing the test. It was probably just an oversight. We should avoid using |
|
Hi @amadio I understand the point. But a very stringent test was in place for x86_64 and somehow I feel that this gives away some of that rigor. |
|
@dpiparo we did correct other cases similar to this one in other tests with @martinmine. Comparing floating point numbers for equality has to be avoided. |
|
Just to say that we can use googletests |
|
I will update this to use the Google test macro as suggested by Vassil. |
|
@phsft-bot build! |
|
Starting build on |
|
@amadio: sure for google test if this does not imply re-writing the entire exec but just reformulating the equality with tolerance. |
|
So, since |
@amadio I agree with you. |
|
@phsft-bot build! |
|
Starting build on |
The exact comparison fails in some architectures where rounding may occur.