why i

Peter Hansen peter at engcorp.com
Tue May 25 04:47:17 EDT 2004


Duncan Booth wrote:

> The actual reason why everyone uses I and then J as the for loop indexes 
> was that Fortran, by default, assumed all variables starting with letters 
> from I-N were integer, and all other variable names were real. Integer 
> names starting with I was presumably chosen for its mnemonic value and the 
> other letters then follow on in sequence, presumably far enough for what 
> the original language designers thought was a reasonable 20:6 split real to 
> integer variables.

Does the FORTRAN usage precede or follow the similar common use by
mathematicians?

My guess is that subscripts i, j, k have been used so for much longer
than FORTRAN has existed, or computers for that matter.

The idea that 'i' is mnemonic for 'integer' is interesting, though.
If the mathematical field is really the origin, rather than FORTRAN,
it would be interesting to know if that was how "they" picked it.

Googling to little avail, the best I could find to help was Hilbert's
1900 address on "23 Mathematical Problems" which he gave to the Int'l
Congress of Mathematics in Paris, proving a usage which predates
FORTRAN by 50-some years.  The interesting page maintained by Jeff
Miller at http://members.aol.com/jeff570/mathsym.html makes no mention
of the topic.

-Peter



More information about the Python-list mailing list