PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: High Entry average rating: No information on entry rating
FORTRAN (Topic)

FORTRAN1 (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



Footnotes

...1
Acronym that comes from For-mula Tran-slating.



Anyone with an account can edit this entry. Please help improve it!

"FORTRAN" is owned by PrimeFan. [ full author list (4) ]
(view preamble | get metadata)

View style:

Log in to rate this entry.
(view current ratings)

Cross-references: Wikipedia, function, Zentrums, variable, NB, positive, Euclid's algorithm, greatest common divisor, integers, group, current, links, code, source, On-Line Encyclopedia of Integer Sequences, algebra, Maple, Mathematica, applications, focus, language, computer
There are 3 references to this entry.

This is version 6 of FORTRAN, born on 2007-03-02, modified 2007-07-11.
Object id is 9007, canonical name is FORTRAN.
Accessed 1242 times total.

Classification:
AMS MSC68W30 (Computer science :: Algorithms :: Symbolic computation and algebraic computation)
 68N15 (Computer science :: Software :: Programming languages)

Pending Errata and Addenda
None.
[ View all 1 ]
Discussion
Style: Expand: Order:
forum policy
A bug in the lautomatic linker? by Koro on 2007-03-03 07:07:50
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.
[ reply | up ]

Interact
post | correct | update request | add example | add (any)