Skip to content
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

isfinite(x) enters infinite loop #221

Closed
scbn opened this issue Jul 24, 2014 · 2 comments
Closed

isfinite(x) enters infinite loop #221

scbn opened this issue Jul 24, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@scbn
Copy link

scbn commented Jul 24, 2014

The function glm::infinite(x) from compatibility.inl calls itself, resulting in an infinite loop when using gcc (non-android / no c++11).

@Groovounet Groovounet added the bug label Jul 24, 2014
@Groovounet Groovounet added this to the GLM 0.9.5 milestone Jul 24, 2014
@Groovounet Groovounet self-assigned this Jul 24, 2014
@Groovounet
Copy link
Member

This issue is now fixed in GLM 0.9.5 branch for GLM 0.9.5.5 release.

Thanks for contributing,
Christophe

@d-leinhaeuser
Copy link

This implementation of isfinite should report any floating point value <= 0 as infinite.

The reason is that for floating point types, std::numeric_limits<T>::min() is actually the smallest representable positive value (i.e. > 0) of the type instead of the smallest representable value overall.
In this case -std::numeric_limits<T>::max() should be used (std::numeric_limits<T>::lower() for C++11).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants