Greetings,

This is an almost trivial patch to get the correct sign for tgammaq.

I don't have a testcase as I don't know where to put one.

OK?

Ed Smith-Rowland


2018-10-24  Edward Smith-Rowland  <3dw...@verizon.net>

	PR libquadmath/68686
	* math/tgammaq.c: Correct sign for negative argument.
Index: libquadmath/math/tgammaq.c
===================================================================
--- libquadmath/math/tgammaq.c	(revision 265345)
+++ libquadmath/math/tgammaq.c	(working copy)
@@ -47,7 +47,9 @@
     /* x == -Inf.  According to ISO this is NaN.  */
     return x - x;
 
-  /* XXX FIXME.  */
   res = expq (lgammaq (x));
-  return signbitq (x) ? -res : res;
+  if (x > 0.0Q || ((int)(-x) & 1) == 1)
+    return res;
+  else
+    return -res;
 }

Reply via email to