You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I am using float NAN to initialize my float vectors. In accord to the float.h from gnu builder, I found that it is expected that fmin fmax in the presence of a non number will choose the number.
i.e:
fmin( nan, value) == value
fmax( nan, value) == value
But it looks like the glm::min / max is not behaving the same. is it supposed?
Btw, is that too bad that I use a NAN to set the vector "not initialized" ?
The text was updated successfully, but these errors were encountered:
fmin and fmax are C++11 only features which makes it hard to generalize to GLM.
I guess adding an extension exposing vector flavors or fmin and fmax could be nice.
If you carefully using your NaN vectors, that is to say, you are never doing any arithmetic on them, I guess it's not too bad. However, I would not consider it as a great coding practice.
I'd expect for glm::min to behave the same as std::min and for glm::fmin to behave the same as std::fmin etc..
The only minor exception would be that for std::max(a, b) where a == b, then a is returned whereas b should be returned. (This has subtle implications if T is a reference.)
Hello!
I am using float NAN to initialize my float vectors. In accord to the float.h from gnu builder, I found that it is expected that fmin fmax in the presence of a non number will choose the number.
i.e:
fmin( nan, value) == value
fmax( nan, value) == value
But it looks like the glm::min / max is not behaving the same. is it supposed?
Btw, is that too bad that I use a NAN to set the vector "not initialized" ?
The text was updated successfully, but these errors were encountered: