projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
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
+++ 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;
+}