This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/67531] No IEEE rounding support for powerpc long double type
- From: "pthaugen at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Sep 2015 13:50:44 +0000
- Subject: [Bug fortran/67531] No IEEE rounding support for powerpc long double type
- Auto-submitted: auto-generated
- References: <bug-67531-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67531
--- Comment #5 from Pat Haugen <pthaugen at gcc dot gnu.org> ---
(In reply to Francois-Xavier Coudert from comment #3)
> How about with this? I'm trying to come as close as possible to the exact
> sequence of fe.etround() calls as the Fortran front-end and runtime library
> would end up performingâ
>
>
> #include <fenv.h>
> #include <stdio.h>
>
> int main (void)
> {
> int r;
> long double x1, x2, x;
>
> x1 = 1;
> x = 3;
> r = fegetround ();
> fesetround (FE_UPWARD);
> x1 = x1 / x;
> fesetround (r);
>
> x2 = 1;
> x = 3;
> r = fegetround ();
> fesetround (FE_DOWNWARD);
> x2 = x2 / x;
> fesetround (r);
>
> printf ("%.40Lg\n", x1);
> printf ("%.40Lg\n", x2);
> }
pthaugen@genoa:~$ ~/install/gcc/trunk/bin/gcc junk.c -lm && ./a.out
0.3333333333333333333333333333333353876586
0.3333333333333333333333333333333292246828