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
.



Relevant Pages

  • Re: Most elegant way to read to allocatable array?
    ... glen herrmannsfeldt wrote: ... to a struct, but I believe even that is implementation dependent. ... the equivalent of unit numbers are FILE constants. ... Fortran unit number are. ...
    (comp.lang.fortran)
  • RE: command for measuring computing time in milli sec.
    ... In a previous article, glen herrmannsfeldt wrote: ... command for calculating the computing time in fortran. ... way to get all the assembler declaration statements in place.) ...
    (comp.lang.fortran)
  • F Edit Descriptor & Blank Interpretation Mode (Was: Parsing TLE data)
    ... "glen herrmannsfeldt" wrote in message ... "The numeric field descriptor Fw.d indicates that the external field ... If the blank interpretation mode is changed during data transfer, it reverts to its previous value whent he data transfer statement terminates. ... The blank interpretation mode is one of several connection modes defined by Fortran 2003. ...
    (comp.lang.fortran)
  • Re: compiler bugs
    ... glen herrmannsfeldt wrote: ... Fortran H did have to invent a lot of the ... As virtual memory became more popular, one common thing to do was to ... without any OVERLAY control cards, and then write it out again. ...
    (comp.compilers)
  • Re: capturing a call system() output into a variable
    ... the Grave Hand of glen herrmannsfeldt Did Inscribe: ... capture the output of a call systeminto a ... Fortran program (after pausing long enough for ... There's a really good dos group on usenet if you're interested. ...
    (comp.lang.fortran)