From bbfbc7edaf992abe1d3d09868be07c4c1cc44db7 Mon Sep 17 00:00:00 2001 From: nsz Date: Tue, 27 Mar 2012 22:17:36 +0200 Subject: math: add dummy tgamma and tgammaf implementations --- src/math/tgammaf.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/math/tgammaf.c (limited to 'src/math/tgammaf.c') 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 + +// 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; +} -- cgit v1.2.1