summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2008-09-09 20:42:56 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2008-09-09 20:42:56 +0000
commit08b1a70e7c1676482a124d5a44dbdd272f92fc89 (patch)
tree2b8f5a0dadcf00d8c54d716f4b064a62710daa45
parent58b4449d310954a03d7d75c72de0f229e7276ef7 (diff)
sigh, gamma got lost
-rw-r--r--include/math.h4
-rw-r--r--lib/libm/Makefile5
-rw-r--r--lib/libm/src/w_gammaf.c29
-rw-r--r--lib/libm/src/w_gammaf_r.c31
-rw-r--r--lib/libm/src/w_lgamma.c32
-rw-r--r--lib/libm/src/w_lgammaf.c29
6 files changed, 125 insertions, 5 deletions
diff --git a/include/math.h b/include/math.h
index bb953739684..00c67571fd8 100644
--- a/include/math.h
+++ b/include/math.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: math.h,v 1.21 2008/09/07 20:36:07 martynas Exp $ */
+/* $OpenBSD: math.h,v 1.22 2008/09/09 20:42:55 martynas Exp $ */
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
@@ -279,9 +279,7 @@ extern float ldexpf(float, int);
extern float logf(float);
extern float log10f(float);
extern float log1pf(float);
-#if 0
extern float log2f(float);
-#endif
extern float logbf(float);
extern float modff(float, float *);
extern float scalbnf(float, int);
diff --git a/lib/libm/Makefile b/lib/libm/Makefile
index 575b40c3880..d803b77c5fe 100644
--- a/lib/libm/Makefile
+++ b/lib/libm/Makefile
@@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $
-# $OpenBSD: Makefile,v 1.54 2008/09/07 20:36:08 martynas Exp $
+# $OpenBSD: Makefile,v 1.55 2008/09/09 20:42:55 martynas Exp $
#
# @(#)Makefile 5.1beta 93/09/24
#
@@ -96,7 +96,8 @@ COMMON_SRCS = b_exp__D.c b_log__D.c b_tgamma.c \
s_rintf.c s_round.c s_roundf.c \
s_scalbn.c s_scalbnf.c s_signgam.c s_significand.c s_significandf.c \
s_sin.c s_sinf.c s_tan.c s_tanf.c s_tanh.c s_tanhf.c s_trunc.c \
- s_truncf.c w_drem.c w_dremf.c w_gamma.c w_gamma_r.c
+ s_truncf.c w_drem.c w_dremf.c w_gamma.c w_gamma_r.c w_gammaf.c \
+ w_gammaf_r.c w_lgamma.c w_lgammaf.c
# math routines for non-IEEE architectures.
NOIEEE_SRCS = n_asincos.c n_acosh.c n_asinh.c n_atan.c n_atanh.c n_cosh.c \
diff --git a/lib/libm/src/w_gammaf.c b/lib/libm/src/w_gammaf.c
new file mode 100644
index 00000000000..16062edf391
--- /dev/null
+++ b/lib/libm/src/w_gammaf.c
@@ -0,0 +1,29 @@
+/* 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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_gammaf.c,v 1.4 1995/11/20 22:06:48 jtc Exp $";
+#endif
+
+#include "math.h"
+#include "math_private.h"
+
+extern int signgam;
+
+float
+gammaf(float x)
+{
+ return lgammaf_r(x,&signgam);
+}
diff --git a/lib/libm/src/w_gammaf_r.c b/lib/libm/src/w_gammaf_r.c
new file mode 100644
index 00000000000..f1c8bbccfa5
--- /dev/null
+++ b/lib/libm/src/w_gammaf_r.c
@@ -0,0 +1,31 @@
+/* w_gammaf_r.c -- float version of w_gamma_r.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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_gammaf_r.c,v 1.4 1995/11/20 22:06:50 jtc Exp $";
+#endif
+
+/*
+ * wrapper float gammaf_r(float x, int *signgamp)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+float
+gammaf_r(float x, int *signgamp) /* wrapper lgammaf_r */
+{
+ return lgammaf_r(x,signgamp);
+}
diff --git a/lib/libm/src/w_lgamma.c b/lib/libm/src/w_lgamma.c
new file mode 100644
index 00000000000..f53a6be5dcd
--- /dev/null
+++ b/lib/libm/src/w_lgamma.c
@@ -0,0 +1,32 @@
+/* @(#)w_lgamma.c 5.1 93/09/24 */
+/*
+ * ====================================================
+ * 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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_lgamma.c,v 1.6 1995/05/10 20:49:24 jtc Exp $";
+#endif
+
+/* double lgamma(double x)
+ * Return the logarithm of the Gamma function of x.
+ *
+ * Method: call lgamma_r
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+extern int signgam;
+
+double
+lgamma(double x)
+{
+ return lgamma_r(x,&signgam);
+}
diff --git a/lib/libm/src/w_lgammaf.c b/lib/libm/src/w_lgammaf.c
new file mode 100644
index 00000000000..0153f2bb5af
--- /dev/null
+++ b/lib/libm/src/w_lgammaf.c
@@ -0,0 +1,29 @@
+/* w_lgammaf.c -- float version of w_lgamma.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.
+ * ====================================================
+ */
+
+#if defined(LIBM_SCCS) && !defined(lint)
+static char rcsid[] = "$NetBSD: w_lgammaf.c,v 1.3 1995/05/10 20:49:30 jtc Exp $";
+#endif
+
+#include "math.h"
+#include "math_private.h"
+
+extern int signgam;
+
+float
+lgammaf(float x)
+{
+ return lgammaf_r(x,&signgam);
+}