Mail Archives: djgpp-workers/2001/06/28/08:07:36
> Here are the casts I came up with.
Thanks!
This one worries me:
> diff -u -3 -r1.1 ef_j0.c
> --- ef_j0.c 1998/02/07 14:13:26 1.1
> +++ ef_j0.c 2001/06/26 18:40:12
> @@ -74,7 +74,7 @@
> * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
> * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
> */
> - if(ix>0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
> + if((__uint32_t)ix>0x80000000U) z = (invsqrtpi*cc)/__ieee754_sqrtf(x);
(there are a few more like this one). 0x80000000U has its MSB set,
and since ix is a signed int, it can never be larger that this number.
So what does this code want to do?
According to the algorithm description in e_j0.c, the double-precision
version of the same function, this snippet is for the case where the
argument is in the [2..Inf] range. So it looks like a bug to me.
Could someone please test arguments in that range, step with a
debugger into the function, and see what's going on?
The rest of the changes look fine to me. Of course, we need to run
the Cygnus test suite to make sure there are no regressions.
- Raw text -