musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/math/tgamma.c
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012年03月27日 22:17:36 +0200
committernsz <nsz@port70.net>2012年03月27日 22:17:36 +0200
commitbbfbc7edaf992abe1d3d09868be07c4c1cc44db7 (patch)
treedd101f1fad64e09dd18cc7ceb71bcb0804f9aae7 /src/math/tgamma.c
parent1b229a2098a35795aa20bd09b8c81c5143e64277 (diff)
downloadmusl-bbfbc7edaf992abe1d3d09868be07c4c1cc44db7.tar.gz
math: add dummy tgamma and tgammaf implementations
Diffstat (limited to 'src/math/tgamma.c')
-rw-r--r--src/math/tgamma.c 16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/math/tgamma.c b/src/math/tgamma.c
new file mode 100644
index 00000000..f3bbe370
--- /dev/null
+++ b/src/math/tgamma.c
@@ -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;
+}
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月05日 17:21:00 +0000

AltStyle によって変換されたページ (->オリジナル) /