Skip to content

glm::equal(val1, val2, int ULPs) gives the wrong answer #965

@petersteneteg

Description

@petersteneteg

This test

if(a.negative() != b.negative())
{
// Check for equality to make sure +0==-0
return a.mantissa() == b.mantissa() && a.exponent() == b.exponent();
}

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions