This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
bug in nextafter{f,} for x86
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sources dot redhat dot com
- Date: Tue, 25 Nov 2003 19:02:36 -0800
- Subject: bug in nextafter{f,} for x86
The following test case fails.
#include <math.h>
#include <float.h>
#include <stdlib.h>
int main()
{
float i = INFINITY;
float m = FLT_MAX;
if (nextafterf(m, i) != i)
abort ();
return 0;
}
This is because
if(hy>=0x7f800000) return x+x; /* overflow */
does not in fact overflow on x86; it gets computed with
long double precision.
r~