math: add dummy tgamma and tgammaf implementations
[musl] / src / math / tgammaf.c
diff --git a/src/math/tgammaf.c b/src/math/tgammaf.c
new file mode 100644 (file)
index 0000000..16df807
--- /dev/null
@@ -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;
+}