This is the mail archive of the
mailing list for the GCC project.
Re: [gfortran] Compute x**(-n) as (1/x)**n
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Tobias Schlüter<tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 08 Jun 2004 22:49:48 +0200
- Subject: Re: [gfortran] Compute x**(-n) as (1/x)**n
- Organization: Moene Computational Physics, Maartensdijk, NL
- References: <40C5F85F.firstname.lastname@example.org> <40C5F929.email@example.com>
Tobias Schlüter wrote:
Toon Moene wrote:
The following change, which I bootstrapped on
powerpc-unknown-linux-gnu (C and f95) without regressions, leads the
Fortran front-end to generate expressions x**(-n) with n constant as
if they were written (1/x)**n.Does this deal correctly with integer x? I remember there were some
special cases somewhere.
It doesn't have to :-) By the time control reaches the point where I
made my change, INTEGER x has already been dealt with.
Hope this helps,
Toon Moene - mailto:firstname.lastname@example.org - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)