diff options
author | nsz <nsz@port70.net> | 2012-03-27 22:17:36 +0200 |
---|---|---|
committer | nsz <nsz@port70.net> | 2012-03-27 22:17:36 +0200 |
commit | bbfbc7edaf992abe1d3d09868be07c4c1cc44db7 (patch) | |
tree | dd101f1fad64e09dd18cc7ceb71bcb0804f9aae7 /src/math/tgammaf.c | |
parent | 1b229a2098a35795aa20bd09b8c81c5143e64277 (diff) | |
download | musl-bbfbc7edaf992abe1d3d09868be07c4c1cc44db7.tar.gz musl-bbfbc7edaf992abe1d3d09868be07c4c1cc44db7.tar.bz2 musl-bbfbc7edaf992abe1d3d09868be07c4c1cc44db7.tar.xz musl-bbfbc7edaf992abe1d3d09868be07c4c1cc44db7.zip |
math: add dummy tgamma and tgammaf implementations
Diffstat (limited to 'src/math/tgammaf.c')
-rw-r--r-- | src/math/tgammaf.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/math/tgammaf.c b/src/math/tgammaf.c new file mode 100644 index 00000000..16df8076 --- /dev/null +++ b/src/math/tgammaf.c @@ -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; +} |