about summary refs log tree commit diff
path: root/src/math/tgamma.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2013-08-15 10:13:02 +0000
committerSzabolcs Nagy <nsz@port70.net>2013-08-15 10:13:02 +0000
commitcd18dc8525a275323819ac4c7826cc3404202f7b (patch)
tree15621a81a9cc8a0c154214ab3e5d387a53e1f7bc /src/math/tgamma.c
parentf29fea00b5bc72d4b8abccba2bb1e312684d1fce (diff)
downloadmusl-cd18dc8525a275323819ac4c7826cc3404202f7b.tar.gz
musl-cd18dc8525a275323819ac4c7826cc3404202f7b.tar.xz
musl-cd18dc8525a275323819ac4c7826cc3404202f7b.zip
math: fix tgamma to raise underflow for large negative values
Diffstat (limited to 'src/math/tgamma.c')
-rw-r--r--src/math/tgamma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/math/tgamma.c b/src/math/tgamma.c
index 691e86a4..f91af735 100644
--- a/src/math/tgamma.c
+++ b/src/math/tgamma.c
@@ -137,6 +137,7 @@ double tgamma(double x)
 	/* x =< -184: tgamma(x)=+-0 with underflow */
 	if (absx >= 184) {
 		if (x < 0) {
+			FORCE_EVAL((float)(0x1p-126/x));
 			if (floor(x) * 0.5 == floor(x * 0.5))
 				return 0;
 			return -0.0;