@@ -751,26 +751,26 @@ complex<_Tp>
751
751
reciprocal(const complex<_Tp>& __x)
752
752
{
753
753
// Handle extreme cases for numpy compatibility
754
- auto both_inf = [](T real, T imag) {
754
+ auto both_inf = [](_Tp real, _Tp imag) {
755
755
return isinf(real) && isinf(imag);
756
756
}
757
757
758
- auto either_inf = [](T real, T imag) {
758
+ auto either_inf = [](_Tp real, _Tp imag) {
759
759
return isinf(real) || isinf(imag);
760
760
}
761
761
762
- auto either_nan = [](T real, T imag) {
762
+ auto either_nan = [](_Tp real, _Tp imag) {
763
763
return isnan(real) || isnan(imag);
764
764
}
765
765
766
766
if (either_nan(__x.real(), __x.imag()) || both_inf(__x.real(), __x.imag())) {
767
767
// If either is Nan or both are infinite, return {nan, nan}
768
- return {std::numeric_limits<T >::quiet_NaN(), std::numeric_limits<T >::quiet_NaN()};
768
+ return {std::numeric_limits<_Tp >::quiet_NaN(), std::numeric_limits<_Tp >::quiet_NaN()};
769
769
} else if (either_inf(__x.real(), __x.imag())) {
770
770
// If either is Inf, return {0, 0}
771
771
return {0, 0};
772
772
}
773
- const complex<T > one = complex<T >(1.0, 0);
773
+ const complex<_Tp > one = complex<_Tp >(1.0, 0);
774
774
return one/__x;
775
775
}
776
776
0 commit comments