Fix potential infinite loop in float_distance().

This commit is contained in:
Guus Sliepen 2017-04-19 13:12:06 +02:00
parent 40398d67cd
commit 85993759b5

View File

@ -287,7 +287,7 @@ namespace glm
if(x < y) if(x < y)
{ {
T temp = x; T temp = x;
while(temp != y)// && ulp < std::numeric_limits<std::size_t>::max()) while(temp < y)// && ulp < std::numeric_limits<std::size_t>::max())
{ {
++ulp; ++ulp;
temp = next_float(temp); temp = next_float(temp);
@ -296,7 +296,7 @@ namespace glm
else if(y < x) else if(y < x)
{ {
T temp = y; T temp = y;
while(temp != x)// && ulp < std::numeric_limits<std::size_t>::max()) while(temp < x)// && ulp < std::numeric_limits<std::size_t>::max())
{ {
++ulp; ++ulp;
temp = next_float(temp); temp = next_float(temp);