aboutsummaryrefslogtreecommitdiff
path: root/w_gamma_r.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:29:30 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:29:30 -0800
commitb07e1d9fd8d9e4e03698e0bd9bf77154c5390326 (patch)
tree87dbea36a0e5ed0f2f8e2a499b9c1014af6a38b5 /w_gamma_r.c
parentf177c949113889342d74aee8011a86bd4f589841 (diff)
downloadfdlibm-b07e1d9fd8d9e4e03698e0bd9bf77154c5390326.tar.gz
auto import from //depot/cupcake/@135843
Diffstat (limited to 'w_gamma_r.c')
-rw-r--r--w_gamma_r.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/w_gamma_r.c b/w_gamma_r.c
new file mode 100644
index 0000000..25bfa1b
--- /dev/null
+++ b/w_gamma_r.c
@@ -0,0 +1,42 @@
+
+/* @(#)w_gamma_r.c 1.3 95/01/18 */
+/*
+ * ====================================================
+ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ *
+ * Developed at SunSoft, a Sun Microsystems, Inc. business.
+ * Permission to use, copy, modify, and distribute this
+ * software is freely granted, provided that this notice
+ * is preserved.
+ * ====================================================
+ */
+
+/*
+ * wrapper double ieee_gamma_r(double x, int *signgamp)
+ */
+
+#include "fdlibm.h"
+
+
+#ifdef __STDC__
+ double ieee_gamma_r(double x, int *signgamp) /* wrapper lgamma_r */
+#else
+ double ieee_gamma_r(x,signgamp) /* wrapper lgamma_r */
+ double x; int *signgamp;
+#endif
+{
+#ifdef _IEEE_LIBM
+ return __ieee754_gamma_r(x,signgamp);
+#else
+ double y;
+ y = __ieee754_gamma_r(x,signgamp);
+ if(_LIB_VERSION == _IEEE_) return y;
+ if(!ieee_finite(y)&&ieee_finite(x)) {
+ if(ieee_floor(x)==x&&x<=0.0)
+ return __kernel_standard(x,x,41); /* gamma pole */
+ else
+ return __kernel_standard(x,x,40); /* gamma overflow */
+ } else
+ return y;
+#endif
+}