This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/33595] FAIL: gfortran.dg/nint_2.f90 -O0 execution test
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Dec 2008 22:14:41 -0000
- Subject: [Bug fortran/33595] FAIL: gfortran.dg/nint_2.f90 -O0 execution test
- References: <bug-33595-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from kargl at gcc dot gnu dot org 2008-12-28 22:14 -------
(In reply to comment #12)
> Subject: Re: FAIL: gfortran.dg/nint_2.f90 -O0 execution test
>
> > See libm on FreeBSD.
> >
> > http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/msun/src/s_roundf.c
>
> So, the ceilf implementation was changed to a floorf implementation
> to correct rounding issues about three years ago...
>
> I'll give it a try. The default rounding mode on hpux is nearest.
>
It also uses your idea or something very similar. Notice the
changes in the if-statements.
if (x >= 0.0) {
- t = ceilf(x);
- if (t - x > 0.5)
- t -= 1.0;
+ t = floorf(x);
+ if (t - x <= -0.5)
+ t += 1.0;
return (t);
} else {
- t = ceilf(-x);
- if (t + x > 0.5)
- t -= 1.0;
+ t = floorf(-x);
+ if (t + x <= -0.5)
+ t += 1.0;
return (-t);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33595