mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-07 21:51:47 +08:00
Fix frexp packetmath tests for MSVC.
(cherry picked from commit 2ed4bee78fc44b37d5e5b9f532f5659f9c978499)
This commit is contained in:
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user