Fixed ldexp and frexp implementations

This commit is contained in:
Christophe Riccio 2013-09-17 01:16:00 +02:00
parent dddcbe58e6
commit aa0b2a5e28
2 changed files with 26 additions and 7 deletions

View File

@ -1077,7 +1077,9 @@ namespace detail
std::numeric_limits<genType>::is_iec559,
"'frexp' only accept floating-point inputs");
return std::frexp(x, exp);
return detail::tvec2<T, P>(
frexp(x.x, exp.x),
frexp(x.y, exp.y));
}
template <typename T, precision P>
@ -1091,7 +1093,10 @@ namespace detail
std::numeric_limits<genType>::is_iec559,
"'frexp' only accept floating-point inputs");
return std::frexp(x, exp);
return detail::tvec3<T, P>(
frexp(x.x, exp.x),
frexp(x.y, exp.y),
frexp(x.z, exp.z));
}
template <typename T, precision P>
@ -1105,7 +1110,11 @@ namespace detail
std::numeric_limits<genType>::is_iec559,
"'frexp' only accept floating-point inputs");
return std::frexp(x, exp);
return detail::tvec4<T, P>(
frexp(x.x, exp.x),
frexp(x.y, exp.y),
frexp(x.z, exp.z),
frexp(x.w, exp.w));
}
template <typename genType, precision P>
@ -1133,7 +1142,9 @@ namespace detail
std::numeric_limits<T>::is_iec559,
"'ldexp' only accept floating-point inputs");
return std::ldexp(x, exp);
return detail::tvec2<T, P>(
ldexp(x.x, exp.x),
ldexp(x.y, exp.y));
}
template <typename T, precision P>
@ -1147,7 +1158,10 @@ namespace detail
std::numeric_limits<T>::is_iec559,
"'ldexp' only accept floating-point inputs");
return std::ldexp(x, exp);
return detail::tvec3<T, P>(
ldexp(x.x, exp.x),
ldexp(x.y, exp.y),
ldexp(x.z, exp.z));
}
template <typename T, precision P>
@ -1161,7 +1175,11 @@ namespace detail
std::numeric_limits<T>::is_iec559,
"'ldexp' only accept floating-point inputs");
return std::ldexp(x, exp);
return detail::tvec4<T, P>(
ldexp(x.x, exp.x),
ldexp(x.y, exp.y),
ldexp(x.z, exp.z),
ldexp(x.w, exp.w));
}
}//namespace glm

View File

@ -59,11 +59,12 @@ GLM 0.9.5.0: 2013-XX-XX
- Optimized packing and unpacking functions
- Removed the normalization of the up argument of lookAt function (#114)
- Added low precision specializations of inversesqrt
- Fixed ldexp implementation
- Fixed ldexp and frexp implementations
- Increased assert coverage
- Increased static_assert coverage
- Replaced GLM traits by STL traits when possible
- Allowed including individual core feature
- Increased unit tests completness
================================================================================
GLM 0.9.4.6: 2013-09-15