Skip to content

Commit

Permalink
mstl: Replace gamma with lgamma
Browse files Browse the repository at this point in the history
gamma is a non-standard extension in the GNU libc, see https://www.gnu.org/software/libc/manual/html_node/Special-Functions.html#index-gamma
And being non-standard, it may give different results on different systems, see https://stackoverflow.com/questions/18116376/what-is-the-definition-for-gammadouble-x-and-why-is-it-different-on-two-gcc-ve 😱
  • Loading branch information
JostMigenda committed Jun 7, 2024
1 parent e05975e commit 3cfd9d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mstl/math2/analysis/special functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ double Gamma(double N){ return tgamma(N);}
}*/

// see Numerical Recipes for the algorithm
double logGamma(double N){ return gamma(N);}
double logGamma(double N){ return lgamma(N);}
/*{ if(N<0.){ throw NEGATIVE_NUMBER("logGamma(double)");}
double ser; double n=N;
double c[6]={ 76.18009172947146,-86.50532032941677, 24.01409824083091,
Expand Down

0 comments on commit 3cfd9d5

Please sign in to comment.