summaryrefslogtreecommitdiff
path: root/lib/libm
diff options
context:
space:
mode:
authorMartynas Venckus <martynas@cvs.openbsd.org>2011-07-08 22:52:57 +0000
committerMartynas Venckus <martynas@cvs.openbsd.org>2011-07-08 22:52:57 +0000
commit0c25aac2a9d6184c5710b85c28a48b14b4ee868e (patch)
treead0bb3b8c76a1f5042fb9e8e8bd6c626e1305129 /lib/libm
parent55dda7e1d1917aeab06bac8c4ec7b9c22a8dbd3a (diff)
Remove the stupid commented out fabs(3), frexp(3), and modf(3)
entries and unused implementations. It is clear that this situation won't change.
Diffstat (limited to 'lib/libm')
-rw-r--r--lib/libm/Makefile5
-rw-r--r--lib/libm/src/s_fabs.c41
-rw-r--r--lib/libm/src/s_frexp.c61
-rw-r--r--lib/libm/src/s_modf.c85
4 files changed, 1 insertions, 191 deletions
diff --git a/lib/libm/Makefile b/lib/libm/Makefile
index 1651cfbe909..1d83d42370e 100644
--- a/lib/libm/Makefile
+++ b/lib/libm/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.89 2011/07/08 22:28:33 martynas Exp $
+# $OpenBSD: Makefile,v 1.90 2011/07/08 22:52:56 martynas Exp $
# $NetBSD: Makefile,v 1.28 1995/11/20 22:06:19 jtc Exp $
#
# @(#)Makefile 5.1beta 93/09/24
@@ -158,9 +158,6 @@ NOIEEE_SRCS = n_acosh.c n_argred.c n_asincos.c n_asinh.c n_atan.c \
n_sincos.c n_sinh.c n_sqrt.c n_support.c n_tan.c n_tanh.c \
n_tgamma.c
-# OpenBSD's C library supplies these functions:
-#COMMON_SRCS+= s_fabs.c s_frexp.c s_modf.c
-
.if (${MACHINE_ARCH} == "vax")
SRCS= ${NOIEEE_SRCS} ${NOIEEE_ARCH}
MAN+= infnan.3
diff --git a/lib/libm/src/s_fabs.c b/lib/libm/src/s_fabs.c
deleted file mode 100644
index 87502784d4c..00000000000
--- a/lib/libm/src/s_fabs.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* @(#)s_fabs.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.
- * ====================================================
- */
-
-/*
- * fabs(x) returns the absolute value of x.
- */
-
-/* LINTLIBRARY */
-
-#include <sys/cdefs.h>
-#include <float.h>
-#include <math.h>
-
-#include "math_private.h"
-
-double
-fabs(double x)
-{
- u_int32_t high;
- GET_HIGH_WORD(high,x);
- SET_HIGH_WORD(x,high&0x7fffffff);
- return x;
-}
-
-#if LDBL_MANT_DIG == 53
-#ifdef lint
-/* PROTOLIB1 */
-long double fabsl(long double);
-#else /* lint */
-__weak_alias(fabsl, fabs);
-#endif /* lint */
-#endif /* LDBL_MANT_DIG == 53 */
diff --git a/lib/libm/src/s_frexp.c b/lib/libm/src/s_frexp.c
deleted file mode 100644
index c290a058a13..00000000000
--- a/lib/libm/src/s_frexp.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/* @(#)s_frexp.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.
- * ====================================================
- */
-
-/*
- * for non-zero x
- * x = frexp(arg,&exp);
- * return a double fp quantity x such that 0.5 <= |x| <1.0
- * and the corresponding binary exponent "exp". That is
- * arg = x*2^exp.
- * If arg is inf, 0.0, or NaN, then frexp(arg,&exp) returns arg
- * with *exp=0.
- */
-
-/* LINTLIBRARY */
-
-#include <sys/cdefs.h>
-#include <float.h>
-#include <math.h>
-
-#include "math_private.h"
-
-static const double
-two54 = 1.80143985094819840000e+16; /* 0x43500000, 0x00000000 */
-
-double
-frexp(double x, int *eptr)
-{
- int32_t hx, ix, lx;
- EXTRACT_WORDS(hx,lx,x);
- ix = 0x7fffffff&hx;
- *eptr = 0;
- if(ix>=0x7ff00000||((ix|lx)==0)) return x; /* 0,inf,nan */
- if (ix<0x00100000) { /* subnormal */
- x *= two54;
- GET_HIGH_WORD(hx,x);
- ix = hx&0x7fffffff;
- *eptr = -54;
- }
- *eptr += (ix>>20)-1022;
- hx = (hx&0x800fffff)|0x3fe00000;
- SET_HIGH_WORD(x,hx);
- return x;
-}
-
-#if LDBL_MANT_DIG == 53
-#ifdef lint
-/* PROTOLIB1 */
-long double frexpl(long double, int *);
-#else /* lint */
-__weak_alias(frexpl, frexp);
-#endif /* lint */
-#endif /* LDBL_MANT_DIG == 53 */
diff --git a/lib/libm/src/s_modf.c b/lib/libm/src/s_modf.c
deleted file mode 100644
index c97408aa99f..00000000000
--- a/lib/libm/src/s_modf.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/* @(#)s_modf.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.
- * ====================================================
- */
-
-/* LINTLIBRARY */
-
-/*
- * modf(double x, double *iptr)
- * return fraction part of x, and return x's integral part in *iptr.
- * Method:
- * Bit twiddling.
- *
- * Exception:
- * No exception.
- */
-
-#include <sys/cdefs.h>
-#include <float.h>
-#include <math.h>
-
-#include "math_private.h"
-
-static const double one = 1.0;
-
-double
-modf(double x, double *iptr)
-{
- int32_t i0,i1,j0;
- u_int32_t i;
- EXTRACT_WORDS(i0,i1,x);
- j0 = ((i0>>20)&0x7ff)-0x3ff; /* exponent of x */
- if(j0<20) { /* integer part in high x */
- if(j0<0) { /* |x|<1 */
- INSERT_WORDS(*iptr,i0&0x80000000,0); /* *iptr = +-0 */
- return x;
- } else {
- i = (0x000fffff)>>j0;
- if(((i0&i)|i1)==0) { /* x is integral */
- u_int32_t high;
- *iptr = x;
- GET_HIGH_WORD(high,x);
- INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
- return x;
- } else {
- INSERT_WORDS(*iptr,i0&(~i),0);
- return x - *iptr;
- }
- }
- } else if (j0>51) { /* no fraction part */
- u_int32_t high;
- *iptr = x*one;
- GET_HIGH_WORD(high,x);
- INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
- return x;
- } else { /* fraction part in low x */
- i = ((u_int32_t)(0xffffffff))>>(j0-20);
- if((i1&i)==0) { /* x is integral */
- u_int32_t high;
- *iptr = x;
- GET_HIGH_WORD(high,x);
- INSERT_WORDS(x,high&0x80000000,0); /* return +-0 */
- return x;
- } else {
- INSERT_WORDS(*iptr,i0,i1&(~i));
- return x - *iptr;
- }
- }
-}
-
-#if LDBL_MANT_DIG == 53
-#ifdef lint
-/* PROTOLIB1 */
-long double modfl(long double, long double *);
-#else /* lint */
-__weak_alias(modfl, modf);
-#endif /* lint */
-#endif /* LDBL_MANT_DIG == 53 */