0

Learning old Fortran77-codes full of "goto-spagetti", I met with the following instruction:

if(condition) label1, label2, label3

where labels are just three numbers. Has anybody any ideas what it means?

bpv_xquest
  • 55
  • 2
  • 8

1 Answers1

3

Arithmetic if. It goes to

  • label1 if the expression is negative
  • label2 if the expression is 0
  • label3 if the expression is positive.

Caveat: If you use it with floating point expressions, note that a result that should be 0 might be "a small number close to 0" due to rounding errors. This limits the usefulness of the arithmetic if.

Hellmar Becker
  • 2,824
  • 12
  • 18