diff --git a/include/armadillo_bits/arma_cmath.hpp b/include/armadillo_bits/arma_cmath.hpp index 79849181..38c81ed6 100644 --- a/include/armadillo_bits/arma_cmath.hpp +++ b/include/armadillo_bits/arma_cmath.hpp @@ -199,14 +199,14 @@ arma_isnan(const std::complex& x) // -// wrappers for arma_pow()---see FP16 specialization below +// wrapper for pow; see also the associated FP16 specialisation -template +template inline eT -arma_pow(eT base, pow_eT pow) +arma_pow(eT base, exponent_eT pow) { return std::pow(base, pow); } @@ -433,7 +433,7 @@ struct arma_arg< std::complex > // -// wrappers for low-precision fp16 +// extensions for half-precision fp16 #if defined(ARMA_HAVE_FP16) @@ -442,13 +442,21 @@ inline bool arma_isfinite(fp16 x) { - // Technically not required until C++23 but basically every compiler supports it. - // (this is true for almost every fp16 overload below) return std::isfinite(x); } +template<> +inline +bool +arma_isnonfinite(fp16 x) + { + return (std::isfinite(x) == false); + } + + + template<> inline bool @@ -469,10 +477,10 @@ arma_isnan(fp16 x) -template +template inline fp16 -arma_pow(fp16 base, pow_eT pow) +arma_pow(fp16 base, exponent_eT pow) { return std::pow(base, fp16(pow)); }