home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!spool.mu.edu!umn.edu!csus.edu!netcom.com!walt
- From: walt@netcom.com (Walt Brainerd)
- Subject: Re: Obscure fortran question
- Message-ID: <1992Dec23.001321.5581@netcom.com>
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <tubetf0@sgi.sgi.com>
- Date: Wed, 23 Dec 1992 00:13:21 GMT
- Lines: 27
-
- In article <tubetf0@sgi.sgi.com>, "John C. Ruttenberg" <rutt@paradise.mti.sgi.com> writes:
- >
- >
- > Suppose the do variable is assigned above the loop and used in the second
- > expression of a do. Should its value there be:
- >
- > 1. Its value above the loop, or
- >
- > 2. The value of the first expression in the do?
- >
- 1 is the correct answer. The standard (Fortran 90) says that
- step one of executing a do loop is to evaluate the expressions
- for the initial value, terminal value, and increment (if any).
- Step two is two initialize the DO variable.
-
- i=10
- do i = 1,i
- ...
- is executed 10 times.
-
- The words in the Fortran 77 standard are similar, I am sure,
- but I didn't check it.
- --
- Walt Brainerd walt@netcom.com
- Unicomp, Inc. +1-415-949-4052
- 235 Mt. Hamilton Ave. +1-415-949-4058 (fax)
- Los Altos, CA 94022 USA "F90--Fortran for the '90s"
-