diff --git a/include/armadillo_bits/op_expmat_meat.hpp b/include/armadillo_bits/op_expmat_meat.hpp index 2c725bc4..41e84650 100644 --- a/include/armadillo_bits/op_expmat_meat.hpp +++ b/include/armadillo_bits/op_expmat_meat.hpp @@ -124,11 +124,15 @@ op_expmat::apply_direct(Mat& out, const Base T(0)) ? double(eop_aux::log2(norm_val)) : double(0); + // const double log2_val = (norm_val > T(0)) ? double(eop_aux::log2(norm_val)) : double(0); + // + // int exponent = int(0); std::frexp(log2_val, &exponent); + // + // const uword s = uword( (std::max)(int(0), exponent + int(1)) ); - int exponent = int(0); std::frexp(log2_val, &exponent); + int exponent = int(0); std::frexp(norm_val, &exponent); - const uword s = uword( (std::max)(int(0), exponent + int(1)) ); + const uword s = uword(exponent); A /= eT(eop_aux::pow(double(2), double(s)));