2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-28 19:32:08 +00:00

Fix for tgamma(x) where x < 0 and denorm.

This commit is contained in:
jzmaddock
2014-02-16 16:24:59 +00:00
parent 7a823466ca
commit 0028c59d7c

View File

@@ -245,7 +245,7 @@ T lgamma_imp(T z, const Policy& pol, const Lanczos& l, int* sign = 0)
if (0 == z)
return policies::raise_pole_error<T>(function, "Evaluation of lgamma at %1%.", z, pol);
if (fabs(z) < 1 / tools::max_value<T>())
result = -log(z);
result = -log(fabs(z));
else
result = log(fabs(1 / z - constants::euler<T>()));
if (z < 0)