diff options
author | 2011-07-08 22:52:56 +0000 | |
---|---|---|
committer | 2011-07-08 22:52:56 +0000 | |
commit | 8559a7c55cf9a54b25cf160a00427443570b0686 (patch) | |
tree | 10275fd0f38776f80cbf4c8c763b60ee1de03d6c /lib/libm/src | |
parent | Alias modfl to modf. This goes together with the previous bump. (diff) | |
download | wireguard-openbsd-8559a7c55cf9a54b25cf160a00427443570b0686.tar.xz wireguard-openbsd-8559a7c55cf9a54b25cf160a00427443570b0686.zip |
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/src')
-rw-r--r-- | lib/libm/src/s_fabs.c | 41 | ||||
-rw-r--r-- | lib/libm/src/s_frexp.c | 61 | ||||
-rw-r--r-- | lib/libm/src/s_modf.c | 85 |
3 files changed, 0 insertions, 187 deletions
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 */ |