Implementation of exp10 wrapper function.
authordrepper <drepper>
Tue, 9 Jun 1998 18:22:07 +0000 (18:22 +0000)
committerdrepper <drepper>
Tue, 9 Jun 1998 18:22:07 +0000 (18:22 +0000)
sysdeps/libm-ieee754/w_exp10.c [new file with mode: 0644]
sysdeps/libm-ieee754/w_exp10f.c [new file with mode: 0644]
sysdeps/libm-ieee754/w_exp10l.c [new file with mode: 0644]

diff --git a/sysdeps/libm-ieee754/w_exp10.c b/sysdeps/libm-ieee754/w_exp10.c
new file mode 100644 (file)
index 0000000..cb27159
--- /dev/null
@@ -0,0 +1,59 @@
+/* @(#)w_exp10.c
+ * Conversion to exp10 by Ulrich Drepper <drepper@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.
+ * ====================================================
+ */
+
+/*
+ * wrapper exp10(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+static const double
+#else
+static double
+#endif
+o_threshold=  3.0825471555991674389672e+02,
+u_threshold= -3.2360724533877978485251e+02;
+
+#ifdef __STDC__
+       double __exp10(double x)                /* wrapper exp10 */
+#else
+       double __exp10(x)                       /* wrapper exp10 */
+       double x;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_exp10(x);
+#else
+       double z;
+       z = __ieee754_exp10(x);
+       if(_LIB_VERSION == _IEEE_) return z;
+       if(__finite(x)) {
+           if(x>o_threshold)
+               return __kernel_standard(x,x,46); /* exp10 overflow */
+           else if(x<u_threshold)
+               return __kernel_standard(x,x,47); /* exp10 underflow */
+       }
+       return z;
+#endif
+}
+weak_alias (__exp10, exp10)
+strong_alias (__exp10, __pow10)
+weak_alias (__pow10, pow10)
+#ifdef NO_LONG_DOUBLE
+strong_alias (__exp10, __exp10l)
+weak_alias (__exp10, exp10l)
+strong_alias (__exp10l, __pow10l)
+weak_alias (__pow10l, pow10l)
+#endif
diff --git a/sysdeps/libm-ieee754/w_exp10f.c b/sysdeps/libm-ieee754/w_exp10f.c
new file mode 100644 (file)
index 0000000..f78be79
--- /dev/null
@@ -0,0 +1,57 @@
+/* w_exp10f.c -- float version of w_exp10.c.
+ * Conversion to exp10 by Ulrich Drepper <drepper@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.
+ * ====================================================
+ */
+
+/*
+ * wrapper expf10(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+static const float
+#else
+static float
+#endif
+o_threshold=  3.853183944498959298709e+01,
+u_threshold= -4.515449934959717928174e+01;
+
+#ifdef __STDC__
+       float __exp10f(float x)         /* wrapper exp10f */
+#else
+       float __exp10f(x)                       /* wrapper exp10f */
+       float x;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_exp10f(x);
+#else
+       float z;
+       z = __ieee754_exp10f(x);
+       if(_LIB_VERSION == _IEEE_) return z;
+       if(__finitef(x)) {
+           if(x>o_threshold)
+               /* exp overflow */
+               return (float)__kernel_standard((double)x,(double)x,146);
+           else if(x<u_threshold)
+               /* exp underflow */
+               return (float)__kernel_standard((double)x,(double)x,147);
+       }
+       return z;
+#endif
+}
+weak_alias (__exp10f, exp10f)
+strong_alias (__exp10f, __pow10f)
+weak_alias (__pow10f, pow10f)
diff --git a/sysdeps/libm-ieee754/w_exp10l.c b/sysdeps/libm-ieee754/w_exp10l.c
new file mode 100644 (file)
index 0000000..7117873
--- /dev/null
@@ -0,0 +1,56 @@
+/* w_exp10l.c -- long double version of w_exp10.c.
+ * Conversion to long double by Ulrich Drepper,
+ * Cygnus Support, drepper@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.
+ * ====================================================
+ */
+
+/*
+ * wrapper exp10l(x)
+ */
+
+#include "math.h"
+#include "math_private.h"
+
+#ifdef __STDC__
+static const long double
+#else
+static long double
+#endif
+o_threshold=  4.93207544895866790234755e+03,
+u_threshold= -4.95104033868549871764588e+03;
+
+#ifdef __STDC__
+       long double __exp10l(long double x)     /* wrapper exp10 */
+#else
+       long double __exp10l(x)                 /* wrapper exp10 */
+       long double x;
+#endif
+{
+#ifdef _IEEE_LIBM
+       return __ieee754_exp10l(x);
+#else
+       long double z;
+       z = __ieee754_exp10l(x);
+       if(_LIB_VERSION == _IEEE_) return z;
+       if(__finitel(x)) {
+           if(x>o_threshold)
+               return __kernel_standard(x,x,246); /* exp10 overflow */
+           else if(x<u_threshold)
+               return __kernel_standard(x,x,247); /* exp10 underflow */
+       }
+       return z;
+#endif
+}
+weak_alias (__exp10l, exp10l)
+strong_alias (__exp10l, __pow10l)
+weak_alias (__pow10l, pow10l)