This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: single to double conversion


Brian Barnes wrote:
On Tue, 26 Sep 2006, Craig Powers wrote:


promotion from integer to floating point may occur later than a naive
user would expect.

I believe if promotion from integer to real occured so late in a simple calculation that it created a mathematically incorrect result, that should be regarded as a bug in gfortran. It's quite possible that the developers disagree with me on this, but I'm just speaking as a chemist who is trying to get some work done in Fortran. I've used g77 for years and not had a problem of this sort. I haven't encountered a problem like that in gfortran either, so I hope nothing has changed.

I'm not sure what you mean by "mathematically incorrect". I was referring to something of the nature of,


REAL bar

! ...

bar = 1/3 + 2.5

where I expect the result of 1/3 will be 0, because promotion to floating point will not happen until the addition with 2.5.


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