mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix frexp packetmath tests for MSVC.
(cherry picked from commit 2ed4bee78f)
This commit is contained in:
committed by
Antonio Sanchez
parent
cd543434bf
commit
d259104c8d
@@ -52,6 +52,12 @@ inline T REF_FREXP(const T& x, T& exp) {
|
|||||||
EIGEN_USING_STD(frexp)
|
EIGEN_USING_STD(frexp)
|
||||||
const T out = static_cast<T>(frexp(x, &iexp));
|
const T out = static_cast<T>(frexp(x, &iexp));
|
||||||
exp = static_cast<T>(iexp);
|
exp = static_cast<T>(iexp);
|
||||||
|
|
||||||
|
// The exponent value is unspecified if the input is inf or NaN, but MSVC
|
||||||
|
// seems to set it to 1. We need to set it back to zero for consistency.
|
||||||
|
if (!(numext::isfinite)(x)) {
|
||||||
|
exp = T(0);
|
||||||
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user