mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Handle special case in atanh2(x,y) when y = 0.
This fixes matrix_power unit test on clang.
This commit is contained in:
parent
03373f41cb
commit
97c9e3c74f
@ -396,7 +396,7 @@ struct atanh2_default_impl
|
||||
using std::log;
|
||||
using std::sqrt;
|
||||
Scalar z = x / y;
|
||||
if (abs(z) > sqrt(NumTraits<RealScalar>::epsilon()))
|
||||
if (y == Scalar(0) || abs(z) > sqrt(NumTraits<RealScalar>::epsilon()))
|
||||
return RealScalar(0.5) * log((y + x) / (y - x));
|
||||
else
|
||||
return z + z*z*z / RealScalar(3);
|
||||
|
Loading…
x
Reference in New Issue
Block a user