Skip to content

Commit

Permalink
Use std::log overload from <cmath> instead of std::logl
Browse files Browse the repository at this point in the history
Many of the [fl] suffix math functions are missing from namespace std
due to a bug in the C++ standard library under gcc.
  • Loading branch information
LegalizeAdulthood committed Dec 31, 2024
1 parent 68822fe commit 110a419
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libid/bigflt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ bf_t unsafe_ln_bf(bf_t r, bf_t n)
}

f = bf_to_float(n);
f = logl(f); // approximate ln(x)
f = std::log(f); // approximate ln(x)
// no need to check overflow
// appears to be ok, do ln

Expand Down
2 changes: 1 addition & 1 deletion libid/bignum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ bn_t unsafe_ln_bn(bn_t r, bn_t n)
}

f = bn_to_float(n);
f = logl(f); // approximate ln(x)
f = std::log(f); // approximate ln(x)
maxval = (1L << ((g_int_length << 3)-1)) - 1;
if (f > maxval) // check for overflow
{
Expand Down
2 changes: 1 addition & 1 deletion libid/fpu087.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void fpu_cmplx_log(const DComplex *x, DComplex *z)
}
if (x->y == 0.0)// x is real
{
z->x = std::logl(x->x);
z->x = std::log(x->x);
z->y = 0.0;
return;
}
Expand Down

0 comments on commit 110a419

Please sign in to comment.