This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 23 Jun 2013 16:10:47 +0000
- Subject: [Bug fortran/52413] Incorrect behavior of FRACTION when applied to a constant
- Auto-submitted: auto-generated
- References: <bug-52413-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52413
--- Comment #13 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Why involve I/O in your test, and not just test the value like that:
>
> if (fraction(-2.0) /= -0.5) call abort()
>
> and, slightly more complicated to handle negative zero, checking both
> value and sign:
>
> if (fraction(-0.0) /= 0.0) call abort
> if (sign(1.0, fraction(-0.0)) /= -1.0) call abort
No good reason, I just did not think of a direct comparison. I'll do the change
later. Thanks for the tips.