-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
glm::equal(val1, val2, int ULPs) gives the wrong answer #965
Comments
This issue should be fixed in master branch. Thanks for contributing, |
Should not -0.0f be equal to 0.0f? |
Btw this code is also in vector_relational.inl |
@Groovounet see above |
Do you have an idea how to implement this correctly? |
This is definitely not in my expertise, but looking at the article referenced from https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ I would guess something similar to this...
|
This test
glm/glm/ext/scalar_relational.inl
Lines 27 to 31 in ea678fa
will return true for any two number of different sign but with equal magnitude.
the test on line 30 should be
return x==y;
Example
https://godbolt.org/z/iR8unh
The text was updated successfully, but these errors were encountered: