diff --git a/src/Magnum/Math/Functions.h b/src/Magnum/Math/Functions.h index 4afe441eb..34328e704 100644 --- a/src/Magnum/Math/Functions.h +++ b/src/Magnum/Math/Functions.h @@ -256,7 +256,7 @@ template inline typename std::enable_if::value, bool>::type template inline BitVector isInf(const Vector& value) { BitVector out; for(std::size_t i = 0; i != size; ++i) - out.set(i, Math::isInf(value[i])); + if(Math::isInf(value[i])) out.set(i); return out; } @@ -278,7 +278,7 @@ template typename std::enable_if::value, bool>::type isNan( template inline BitVector isNan(const Vector& value) { BitVector out; for(std::size_t i = 0; i != size; ++i) - out.set(i, Math::isNan(value[i])); + if(Math::isNan(value[i])) out.set(i); return out; }