This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/67531] No IEEE rounding support for powerpc long double type


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]