mirror of
git://git.musl-libc.org/musl
synced 2025-01-05 14:09:56 +00:00
math: add dummy tgamma and tgammaf implementations
This commit is contained in:
parent
1b229a2098
commit
bbfbc7edaf
16
src/math/tgamma.c
Normal file
16
src/math/tgamma.c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
// FIXME: use lanczos approximation
|
||||||
|
|
||||||
|
double __lgamma_r(double, int *);
|
||||||
|
|
||||||
|
double tgamma(double x)
|
||||||
|
{
|
||||||
|
int sign;
|
||||||
|
double y;
|
||||||
|
|
||||||
|
y = exp(__lgamma_r(x, &sign));
|
||||||
|
if (sign < 0)
|
||||||
|
y = -y;
|
||||||
|
return y;
|
||||||
|
}
|
16
src/math/tgammaf.c
Normal file
16
src/math/tgammaf.c
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
// FIXME: use lanczos approximation
|
||||||
|
|
||||||
|
float __lgammaf_r(float, int *);
|
||||||
|
|
||||||
|
float tgammaf(float x)
|
||||||
|
{
|
||||||
|
int sign;
|
||||||
|
float y;
|
||||||
|
|
||||||
|
y = exp(__lgammaf_r(x, &sign));
|
||||||
|
if (sign < 0)
|
||||||
|
y = -y;
|
||||||
|
return y;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user