mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
committed by
Rasmus Munk Larsen
parent
b0ebf966a5
commit
ca94be70da
@@ -155,10 +155,9 @@ EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE RealScalar positive_real_hypot(c
|
||||
if ((numext::isnan)(x) || (numext::isnan)(y)) return NumTraits<RealScalar>::quiet_NaN();
|
||||
|
||||
EIGEN_USING_STD(sqrt);
|
||||
RealScalar p, qp;
|
||||
p = numext::maxi(x, y);
|
||||
RealScalar p = numext::maxi(x, y);
|
||||
if (numext::is_exactly_zero(p)) return RealScalar(0);
|
||||
qp = numext::mini(y, x) / p;
|
||||
RealScalar qp = numext::mini(y, x) / p;
|
||||
return p * sqrt(RealScalar(1) + qp * qp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user