소스 검색

math: fix tgamma to raise underflow for large negative values

Szabolcs Nagy 12 년 전
부모
커밋
cd18dc8525
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      src/math/tgamma.c

+ 1 - 0
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;