This statement is an arithmetic if.
If EPS < 0.0 then control will transfer to 24
If EPS = 0.0 then control will transfer to 26
If EPS > 0.0 then control will transfer to 27
This archaic feature is so poorly thought off in modern Fortran programming
practice that it is often not even mentioned in introductory classes.
I'll allow others to discuss why and give the historical reason why
it is in the language at all. Not recommended for new code. I recommend
adding a comment describing the intent if you are maintaining old code.
- Patrick McGehearty
On ICL 1900 and 2900 series computers, there was a variant ... here's
and example:
IF (RES) 25, 0, 0
Statement number 0 meant "on the next line"
Sometimes it is useful to know where one is going in the case of an
expression evaluating to neg, zero or pos, simply because the zero
result does come up remarkably often!
In this sort of code:
P = result of some computation
R = anyvalue / P
then something like
P =
IF (P) 100, 1600, 100
100 R = anyvalue / P
traps the inevitable overflow. When used like this, 1600 was the
statement of the error handling code.
Whether or not you hate this sort of thing : GOTOs, ASSIGNED GOTOs and
COMPUTED GOTOs, tolerate them or love them really depends on whether
you like to know where you are going before you arrive!
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
Similarly, GE625 Fortran and its successors used a null statement number to
designate "no branch." Even when the arithmetic IF was syntactically
equivalent to a more modern style of conditional GOTO, it saved a branch, so it
seemed that the optimizer intentionally favored archaic and non-standard code.
Seems I've made that comment about much more recent compilers.
Tim Prince
tpr...@computer.org