summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <vinschen@redhat.com>2007-12-11 15:15:32 +0000
committerCorinna Vinschen <vinschen@redhat.com>2007-12-11 15:15:32 +0000
commit48fc273b5341b5e8cbb0f9b0ef62d22c743f0bf0 (patch)
treee4a697e946dafa18bc9ddf402649d7eaec386b7d
parent6937250b1cce676362e2efdc2a05505967dc1ced (diff)
downloadgdb-48fc273b5341b5e8cbb0f9b0ef62d22c743f0bf0.tar.gz
* libm/math/wf_tgamma.c: Add missing include.
-rw-r--r--newlib/ChangeLog4
-rw-r--r--newlib/libm/math/wf_tgamma.c45
2 files changed, 49 insertions, 0 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog
index 52a28828abe..6efaf9627c3 100644
--- a/newlib/ChangeLog
+++ b/newlib/ChangeLog
@@ -15,6 +15,10 @@
* libc/stdio/vfprintf.c (_VFPRINTF_R): Take precision into account
for %s on NULL. Skip NULL check when optimizing for size.
+2007-09-04 Kazunori Asayama <asayama@sm.sony.co.jp>
+
+ * libm/math/wf_tgamma.c: Add missing include.
+
2007-07-31 Eric Blake <ebb9@byu.net>
More POSIX stream corner cases.
diff --git a/newlib/libm/math/wf_tgamma.c b/newlib/libm/math/wf_tgamma.c
new file mode 100644
index 00000000000..2b57d845f77
--- /dev/null
+++ b/newlib/libm/math/wf_tgamma.c
@@ -0,0 +1,45 @@
+/* w_gammaf.c -- float version of w_gamma.c.
+ * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
+ */
+
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunPro, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+#include "math.h"
+#include "fdlibm.h"
+
+#ifdef __STDC__
+ float tgammaf(float x)
+#else
+ float tgammaf(x)
+ float x;
+#endif
+{
+ float y;
+ int local_signgam;
+ y = __ieee754_gammaf_r(x,&local_signgam);
+ if (local_signgam < 0) y = -y;
+#ifdef _IEEE_LIBM
+ return y;
+#else
+ if(_LIB_VERSION == _IEEE_) return y;
+
+ if(!finitef(y)&&finitef(x)) {
+ if(floorf(x)==x&&x<=(float)0.0)
+ /* tgammaf pole */
+ return (float)__kernel_standard((double)x,(double)x,141);
+ else
+ /* tgammaf overflow */
+ return (float)__kernel_standard((double)x,(double)x,140);
+ }
+ return y;
+#endif
+}