## You are here

HomeFORTRAN

## Primary tabs

# FORTRAN

FORTRAN^{1}^{1}Acronym that comes from *For-mula Tran-slating.* (or ForTran or Fortran) is a computer programming language developed by IBM in the 1950s with a focus on scientific and engineering applications. FORTRAN is still in use today in the sciences despite the dominance of C++ for most general applications and Mathematica and Maple for algebra applications. Sloane’s On-Line Encyclopedia of Integer Sequences does not include FORTRAN source code but provides links to it. The current version is FORTRAN 2003; an international group of corporations and programmers is working on FORTRAN 2008.

The following FORTRAN program takes two integers as inputs and outputs their greatest common divisor using Euclid’s algorithm. It requires positive integers as inputs. NB is just a variable name that has nothing to do with Zentrums. The function NGCD is defined after the main program. It was written by Wikipedia user Rwwww:

* euclid.f (FORTRAN 77) * Find greatest common divisor using the Euclidean algorithm * Written by: Wikipedia User:Rwwww PROGRAM EUCLID PRINT *, 'A?' READ *, NA IF (NA.LE.0) THEN PRINT *, 'A must be a positive integer.' STOP END IF PRINT *, 'B?' READ *, NB IF (NB.LE.0) THEN PRINT *, 'B must be a positive integer.' STOP END IF PRINT *, 'The GCD of', NA, ' and', NB, ' is', NGCD(NA, NB), '.' STOP END FUNCTION NGCD(NA, NB) IA = NA IB = NB 1 IF (IB.NE.0) THEN ITEMP = IA IA = IB IB = MOD(ITEMP, IB) GOTO 1 END IF NGCD = IA RETURN END

## Mathematics Subject Classification

68W30*no label found*68N15

*no label found*

- Forums
- Planetary Bugs
- HS/Secondary
- University/Tertiary
- Graduate/Advanced
- Industry/Practice
- Research Topics
- LaTeX help
- Math Comptetitions
- Math History
- Math Humor
- PlanetMath Comments
- PlanetMath System Updates and News
- PlanetMath help
- PlanetMath.ORG
- Strategic Communications Development
- The Math Pub
- Testing messages (ignore)

- Other useful stuff

## Comments

## A bug in the lautomatic linker?

Is this a bug? Apparently the automatic linker is not working inside the verbatim environment:

PRINT *, 'A must be a \htmladdnormallink{positive}{http://planetmath.org/encyclopedia/Negative.html} integer.'

(there are no manual links in the source)

By the way, apparently \PMlinkescapetext doesnt linke multiple paragraphs (or a complete environment, maybe?) since applying ot to the whole verbatim environment gives an error message.

One could escape the linked words one by one, but this is far from an optimal solution, since new words in the encyclopedia could still mess things up.

## Re: A bug in the lautomatic linker?

It's either a bug or it is some setting which I'm not aware of and which I failed to set correctly. I would want the automatic linker to either not do anything to the verbatim environment or to work as it usually does. Another problem is that all the indentation is being ignored, but for now the linking problem should be the higher priority.

## Re: A bug in the lautomatic linker?

Without looking at the source code, I think the best thing to do would be to program the autolinker to just ignore verbatims. It seems that the autolinker is being engaged before the rendering engine. At first I thought maybe the solution would be to run the rendering engine first and then the autolinker, but that probably would create an entirely different set of problems. Again, keep in mind I don't have access to the source code so my comments in this matter weigh less than those of someone who has.