diff options
author | Sergey Cherkashin <4erkashin@list.ru> | 2017-10-03 15:26:34 +0300 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2017-11-03 20:23:10 +0100 |
commit | ea38f4d89c9698895b1cf53a5946429dc1d8bbaa (patch) | |
tree | e05828ca1fedf55f104b837bc9c44215c2978e99 /libm/e_lgamma_r.c | |
parent | 68de9946e914d8c30dcc6667a059ea59e5b74cac (diff) |
math: add exception handling functionality
According to standards SVID and SYSV.
Modified lgamma calling in case when 'signgam' variable should not be used.
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
Diffstat (limited to 'libm/e_lgamma_r.c')
-rw-r--r-- | libm/e_lgamma_r.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/libm/e_lgamma_r.c b/libm/e_lgamma_r.c index 82005ea17..1f3377df2 100644 --- a/libm/e_lgamma_r.c +++ b/libm/e_lgamma_r.c @@ -295,36 +295,11 @@ double __ieee754_lgamma_r(double x, int *signgamp) return r; } -strong_alias(__ieee754_lgamma_r, lgamma_r) -libm_hidden_def(lgamma_r) - -/* __ieee754_lgamma(x) - * Return the logarithm of the Gamma function of x. - */ -double __ieee754_lgamma(double x) -{ - return __ieee754_lgamma_r(x, &signgam); -} - -strong_alias(__ieee754_lgamma, lgamma); -libm_hidden_def(lgamma) - - -/* NB: gamma function is an old name for lgamma. - * It is deprecated. - * Some C math libraries redefine it as a "true gamma", i.e., - * not a ln(|Gamma(x)|) but just Gamma(x), but standards - * introduced tgamma name for that. - */ -strong_alias(__ieee754_lgamma_r, gamma_r) -strong_alias(__ieee754_lgamma, gamma) -libm_hidden_def(gamma) - /* double tgamma(double x) * Return the Gamma function of x. */ -double tgamma(double x) +double __ieee754_tgamma(double x) { int sign_of_gamma; int32_t hx; @@ -351,5 +326,4 @@ double tgamma(double x) x = exp(lgamma_r(x, &sign_of_gamma)); return sign_of_gamma >= 0 ? x : -x; -} -libm_hidden_def(tgamma) +}
\ No newline at end of file |