diff options
author | das <das@FreeBSD.org> | 2004-12-16 20:40:37 +0000 |
---|---|---|
committer | das <das@FreeBSD.org> | 2004-12-16 20:40:37 +0000 |
commit | 8daeb2e028ae11c31a04910c50123d414c4fa58f (patch) | |
tree | 1038aef22f8883fc477be09dcdd7f09aaf7b4358 /lib/msun/bsdsrc/b_log.c | |
parent | 2b107b7efead9b725aa5ed00b12dbc47ac8ac179 (diff) | |
download | FreeBSD-src-8daeb2e028ae11c31a04910c50123d414c4fa58f.zip FreeBSD-src-8daeb2e028ae11c31a04910c50123d414c4fa58f.tar.gz |
Cosmetic changes only:
- style
- remove unused variables
- de-support VAX
Inspired by: bin/42388
Diffstat (limited to 'lib/msun/bsdsrc/b_log.c')
-rw-r--r-- | lib/msun/bsdsrc/b_log.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/lib/msun/bsdsrc/b_log.c b/lib/msun/bsdsrc/b_log.c index 75cd81e..95d366d 100644 --- a/lib/msun/bsdsrc/b_log.c +++ b/lib/msun/bsdsrc/b_log.c @@ -77,15 +77,8 @@ __FBSDID("$FreeBSD$"); * +Inf return +Inf */ -#if defined(vax) || defined(tahoe) -#define _IEEE 0 -#define TRUNC(x) x = (double) (float) (x) -#else -#define _IEEE 1 #define endian (((*(int *) &one)) ? 1 : 0) #define TRUNC(x) *(((int *) &x) + endian) &= 0xf8000000 -#define infnan(x) 0.0 -#endif #define N 128 @@ -381,26 +374,19 @@ log(x) double x; /* Catch special cases */ if (x <= 0) - if (_IEEE && x == zero) /* log(0) = -Inf */ + if (x == zero) /* log(0) = -Inf */ return (-one/zero); - else if (_IEEE) /* log(neg) = NaN */ + else /* log(neg) = NaN */ return (zero/zero); - else if (x == zero) /* NOT REACHED IF _IEEE */ - return (infnan(-ERANGE)); - else - return (infnan(EDOM)); else if (!finite(x)) - if (_IEEE) /* x = NaN, Inf */ - return (x+x); - else - return (infnan(ERANGE)); + return (x+x); /* x = NaN, Inf */ /* Argument reduction: 1 <= g < 2; x/2^m = g; */ /* y = F*(1 + f/F) for |f| <= 2^-8 */ m = logb(x); g = ldexp(x, -m); - if (_IEEE && m == -1022) { + if (m == -1022) { j = logb(g), m += j; g = ldexp(g, -j); } @@ -461,7 +447,7 @@ __log__D(x) double x; m = logb(x); g = ldexp(x, -m); - if (_IEEE && m == -1022) { + if (m == -1022) { j = logb(g), m += j; g = ldexp(g, -j); } |