diff options
author | Martynas Venckus <martynas@cvs.openbsd.org> | 2008-07-16 15:25:52 +0000 |
---|---|---|
committer | Martynas Venckus <martynas@cvs.openbsd.org> | 2008-07-16 15:25:52 +0000 |
commit | 47ab849be0f58fcb26e9c7ddc9c4c3cc8a54802f (patch) | |
tree | 2e517197a647853e7a0af3c7682b329cf9aedc73 /lib/libm | |
parent | a8a8c53a2a7701bd8b02a7c64e0a60941752eb45 (diff) |
some archaic 'n = a(b), c(d)' use that confused lint
ok millert@
Diffstat (limited to 'lib/libm')
-rw-r--r-- | lib/libm/noieee_src/n_lgamma.c | 14 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_log.c | 20 | ||||
-rw-r--r-- | lib/libm/noieee_src/n_support.c | 14 | ||||
-rw-r--r-- | lib/libm/src/b_log__D.c | 11 |
4 files changed, 40 insertions, 19 deletions
diff --git a/lib/libm/noieee_src/n_lgamma.c b/lib/libm/noieee_src/n_lgamma.c index 06224770f41..1cf10a7c0d2 100644 --- a/lib/libm/noieee_src/n_lgamma.c +++ b/lib/libm/noieee_src/n_lgamma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_lgamma.c,v 1.6 2008/06/21 08:26:19 martynas Exp $ */ +/* $OpenBSD: n_lgamma.c,v 1.7 2008/07/16 15:25:51 martynas Exp $ */ /*- * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -156,8 +156,10 @@ lgamma(double x) } else if (x > 1e-16) return (small_lgam(x)); else if (x > -1e-16) { - if (x < 0) - signgam = -1, x = -x; + if (x < 0) { + signgam = -1; + x = -x; + } return (-log(x)); } else return (neg_lgam(x)); @@ -301,8 +303,10 @@ neg_lgam(double x) else return(infnan(ERANGE)); y = tgamma(x); - if (y < 0) - y = -y, signgam = -1; + if (y < 0) { + y = -y; + signgam = -1; + } return (log(y)); } z = floor(x + .5); diff --git a/lib/libm/noieee_src/n_log.c b/lib/libm/noieee_src/n_log.c index b7cf17753cf..63d1cb943a1 100644 --- a/lib/libm/noieee_src/n_log.c +++ b/lib/libm/noieee_src/n_log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_log.c,v 1.6 2008/06/21 08:26:19 martynas Exp $ */ +/* $OpenBSD: n_log.c,v 1.7 2008/07/16 15:25:51 martynas Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -391,7 +391,8 @@ log(double x) m = logb(x); g = ldexp(x, -m); if (_IEEE && m == -1022) { - j = logb(g), m += j; + j = logb(g); + m += j; g = ldexp(g, -j); } j = N*(g-1) + .5; @@ -408,8 +409,10 @@ log(double x) * u1 has at most 35 bits, and F*u1 is exact, as F has < 8 bits. * It also adds exactly to |m*log2_hi + log_F_head[j] | < 750 */ - if (m | j) - u1 = u + 513, u1 -= 513; + if (m | j) { + u1 = u + 513; + u1 -= 513; + } /* case 2: |1-x| < 1/256. The m- and j- dependent terms are zero; * u1 = u to 24 bits. @@ -449,7 +452,8 @@ __log__D(double x) m = logb(x); g = ldexp(x, -m); if (_IEEE && m == -1022) { - j = logb(g), m += j; + j = logb(g); + m += j; g = ldexp(g, -j); } j = N*(g-1) + .5; @@ -460,8 +464,10 @@ __log__D(double x) u = 2*f*g; v = u*u; q = u*v*(A1 + v*(A2 + v*(A3 + v*A4))); - if (m | j) - u1 = u + 513, u1 -= 513; + if (m | j) { + u1 = u + 513; + u1 -= 513; + } else { u1 = u; TRUNC(u1); diff --git a/lib/libm/noieee_src/n_support.c b/lib/libm/noieee_src/n_support.c index a9449a1164d..947ca0037b2 100644 --- a/lib/libm/noieee_src/n_support.c +++ b/lib/libm/noieee_src/n_support.c @@ -1,4 +1,4 @@ -/* $OpenBSD: n_support.c,v 1.11 2008/06/25 17:49:31 martynas Exp $ */ +/* $OpenBSD: n_support.c,v 1.12 2008/07/16 15:25:51 martynas Exp $ */ /* $NetBSD: n_support.c,v 1.1 1995/10/10 23:37:06 ragge Exp $ */ /* * Copyright (c) 1985, 1993 @@ -314,7 +314,10 @@ sqrt(double x) for(i=1;i<=k;i++) { t=s+1; x *= 4; r /= 2; if(t<=x) { - s=t+t+2, x -= t; q += r;} + s = t+t+2; + x -= t; + q += r; + } else s *= 2; } @@ -383,7 +386,12 @@ remainder(double x, double y) /* subnormal number */ nx=0; - if(yexp==0) {t=1.0,pt[n0]+=m57; y*=t; nx=m57;} + if (yexp == 0) { + t = 1.0; + pt[n0] += m57; + y *= t; + nx = m57; + } /* if y is tiny (biased exponent <= 57), scale up y to y*2**57 */ if( yexp <= m57 ) {py[n0]+=m57; nx+=m57; yexp+=m57;} diff --git a/lib/libm/src/b_log__D.c b/lib/libm/src/b_log__D.c index 7e8c82046d5..e5bee43e2cd 100644 --- a/lib/libm/src/b_log__D.c +++ b/lib/libm/src/b_log__D.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_log__D.c,v 1.2 2008/06/12 22:15:36 martynas Exp $ */ +/* $OpenBSD: b_log__D.c,v 1.3 2008/07/16 15:25:51 martynas Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -368,7 +368,8 @@ __log__D(double x) m = logb(x); g = ldexp(x, -m); if (m == -1022) { - j = logb(g), m += j; + j = logb(g); + m += j; g = ldexp(g, -j); } j = N*(g-1) + .5; @@ -379,8 +380,10 @@ __log__D(double x) u = 2*f*g; v = u*u; q = u*v*(A1 + v*(A2 + v*(A3 + v*A4))); - if (m | j) - u1 = u + 513, u1 -= 513; + if (m | j) { + u1 = u + 513; + u1 -= 513; + } else { u1 = u; TRUNC(u1); |