This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to determine that 2.0 == (float) 2 in a front-end.
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: tej at melbpc dot org dot au, gcc at gcc dot gnu dot org
- Date: Sun, 30 Jun 2002 13:13:01 +0200
- Subject: Re: How to determine that 2.0 == (float) 2 in a front-end.
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <20020630045143.2CAD0F28C9@nile.gnat.com>
Robert Dewar wrote:
> I wrote:
> > x**6.0 can be rendered as x**6 (which is y=x*x, z=y*y, z=z*y).
>
> Note that this is liikely less accurate than calling a well written
> pow routine.
>
> Note that for example x*x*x*x is generally more accurate than x**2**2
>
> I don't necesarily argue for the more accurate form (generally Fortran
> operates in the "who cares that much about last bit accuracy anyway")
> but it is good to be aware of these things.
Yes, that's why it will only be allowed under unsafe_math_optimizations
(once I get around figgerin' out how to do it, of course).
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)