This is the mail archive of the
`gcc-patches@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] |

*From*: Toon Moene <toon at moene dot org>*To*: Dave Korn <dave dot korn dot cygwin at gmail dot com>*Cc*: Tobias Burnus <burnus at net-b dot de>, Steve Kargl <sgk at troutmask dot apl dot washington dot edu>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org*Date*: Sat, 24 Jul 2010 20:33:58 +0200*Subject*: Re: Revision 162491 -- fortran -fwhole-file regressions*References*: <20100724032640.GA23140@troutmask.apl.washington.edu> <4C4A8AA4.5090404@net-b.de> <4C4AEC1D.70307@gmail.com> <4C4B02DB.7010808@moene.org>

Dave Korn wrote:

Ah, this is Return of the Revenge of PR323 Strikes Back! :-P

Could fortran be made to usefully implement -fexcess-precision=standard?

I'm surprised this hasn't been more of an issue given the prevalence of big

number-crunching apps in the fortran world.

That is because Fortran (the Language) makes no promises. All arithmetic is "an approximation to the mathematically exact result".

Hmm, this apparently shocked everyone so much that - in 3 hours - no rebuttal has been posted.

PRINT*,2.+2. END

PRINT*, 1./5. .EQ. 0.2 END

[ Note: one fifth is not exactly representable in IEEE 754 floating point - the division is in most compilers done differently from the parsing of the 0.2 constant. ]

PRINT*, SIN(4.*ATAN(1.)/6.) .EQ. 0.5 END

[ Note: 4 atan (1) / 6 is an approximation to 30 degrees in radians - is the sine routine "good enough" to reproduce sin(30 degrees) = 1/2 ? ]

-- Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290 Saturnushof 14, 3738 XG Maartensdijk, The Netherlands At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/ Progress of GNU Fortran: http://gcc.gnu.org/gcc-4.5/changes.html#Fortran

**Follow-Ups**:**Re: Revision 162491 -- fortran -fwhole-file regressions***From:*Dave Korn

**References**:**Revision 162491 -- fortran -fwhole-file regressions***From:*Steve Kargl

**Re: Revision 162491 -- fortran -fwhole-file regressions***From:*Tobias Burnus

**Re: Revision 162491 -- fortran -fwhole-file regressions***From:*Dave Korn

**Re: Revision 162491 -- fortran -fwhole-file regressions***From:*Toon Moene

Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|

Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |