Re: floating-point DO loops

glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

How about:

x = x1*(float(n_steps-i)/float(n_step-1))+x2*(float(i-1)/float(n_steps-1))

Any other matters aside, I'd recommend updating to at least Fortran 77.

The float intrinsic is a holdover from Fortran 66. While it is still in
the standard (even f2003 - and I recall no proposal to delete it from
f2008 either) for compatibility, you'd have to work darned hard to find
any case where I'd say it made sense to use it today. This isn't even
close to such a case.

Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain| experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain