diff options
author | Paolo Bonzini <bonzini@gnu.org> | 2008-04-15 15:25:38 +0200 |
---|---|---|
committer | Paolo Bonzini <bonzini@gnu.org> | 2008-04-15 15:26:47 +0200 |
commit | a5c02266250d51d94c137f4fca8bec8e7654ff8c (patch) | |
tree | 829b4689c108a439e836897e2b1ad3d50e48af31 | |
parent | 7563f3f5af6f0c71e1ae6d45fb125ccee1f45ebc (diff) | |
download | gnulib-a5c02266250d51d94c137f4fca8bec8e7654ff8c.tar.gz |
fix typos in mathl
2008-04-15 Paolo Bonzini <bonzini@gnu.org>
* lib/tanl.c (kernel_tanl): Rename flag to invert, initialize it
to 0.
* lib/trigl.c (ieee754_rem_pio2l): Fix range checks.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/tanl.c | 6 | ||||
-rw-r--r-- | lib/trigl.c | 9 |
3 files changed, 13 insertions, 8 deletions
@@ -1,3 +1,9 @@ +2008-04-15 Paolo Bonzini <bonzini@gnu.org> + + * lib/tanl.c (kernel_tanl): Rename flag to invert, initialize it + to 0. + * lib/trigl.c (ieee754_rem_pio2l): Fix range checks. + 2008-04-14 Bruno Haible <bruno@clisp.org> * m4/calloc.m4 (_AC_FUNC_CALLOC_IF): Fix underquoting of diff --git a/lib/tanl.c b/lib/tanl.c index 64a84b86f8..11b63adfcb 100644 --- a/lib/tanl.c +++ b/lib/tanl.c @@ -125,7 +125,7 @@ long double kernel_tanl (long double x, long double y, int iy) { long double z, r, v, w, s, u, u1; - int flag, sign; + int invert = 0, sign; sign = 1; if (x < 0) @@ -147,7 +147,7 @@ kernel_tanl (long double x, long double y, int iy) } if (x >= 0.6743316650390625) /* |x| >= 0.6743316650390625 */ { - flag = 1; + invert = 1; z = pio4hi - x; w = pio4lo - y; @@ -163,7 +163,7 @@ kernel_tanl (long double x, long double y, int iy) r = y + z * (s * r + y); r += TH * s; w = x + r; - if (flag) + if (invert) { v = (long double) iy; w = (v - 2.0 * (x - (w * w / (w + v) - r))); diff --git a/lib/trigl.c b/lib/trigl.c index ecdce321a7..6f9dcf5265 100644 --- a/lib/trigl.c +++ b/lib/trigl.c @@ -205,7 +205,7 @@ ieee754_rem_pio2l (long double x, long double *y) int exp, n; if (x >= -0.78539816339744830961566084581987572104929234984377 - && x < 0.78539816339744830961566084581987572104929234984377) + && x <= 0.78539816339744830961566084581987572104929234984377) /* x in <-pi/4, pi/4> */ { y[0] = x; @@ -213,9 +213,7 @@ ieee754_rem_pio2l (long double x, long double *y) return 0; } - if (x >= 2.35619449019234492884698253745962716314787704953131 - && x < 2.35619449019234492884698253745962716314787704953131) - if (x > 0) + if (x > 0 && x < 2.35619449019234492884698253745962716314787704953131) { /* 113 + 93 bit PI is ok */ z = x - PI_2_1; @@ -223,7 +221,8 @@ ieee754_rem_pio2l (long double x, long double *y) y[1] = (z - y[0]) - PI_2_1t; return 1; } - else + + if (x < 0 && x > -2.35619449019234492884698253745962716314787704953131) { /* 113 + 93 bit PI is ok */ z = x + PI_2_1; |