PlanetMath (more info)
 Math for the people, by the people.
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: Very low
iterator (Definition)

An iterator is a variable that one by one takes on all the values (usually integers) in a given range. The letter $ i$ is often used for iterators (though that letter is overloaded as the imaginary unit), $ j$ is often used as a second iterator.

In mathematics iterators are most often used in sum and product notation. For example, in

$\displaystyle \prod_{i = 3}^7 42i^2$
the iterator $ i$ takes on values from 3 to 7.

In computer programming languages iterators are often associated with the "for" reserved word, e.g., “FOR I = 1 TO 47” in BASIC, “for (i = 1; i < 48; i++)” in C++. In Mathematica, iterators are often given in curly braces together with an (omittable) initial value and a required finish value separated by commas, e.g., “Table[2^n - 1, {n, 2, 48}]”.



"iterator" is owned by PrimeFan. [ owner history (1) ]
(view preamble)

View style:

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

Cross-references: separated, Mathematica, C, BASIC, languages, product, sum, imaginary unit, overloaded, range, integers, variable
There are 15 references to this entry.

This is version 3 of iterator, born on 2006-11-19, modified 2006-11-25.
Object id is 8571, canonical name is Iterator.
Accessed 1023 times total.

Classification:
AMS MSC68N15 (Computer science :: Software :: Programming languages)

Pending Errata and Addenda
None.
[ View all 2 ]
Discussion
Style: Expand: Order:
forum policy
1729 points by Mravinci on 2006-11-21 17:23:54
Oh dang, so close to 1729 points. But I have to take silverfish's advice and edit this article accordingly, which will certainly put me over. But maybe I can hit some other interesting number before I log off.
[ reply | up ]
equalsign by Mravinci on 2006-11-19 16:51:16
I tried escaping the equal sign in the BASIC and C++ examples with a backslash, but in the preview that gave me "FOR I \ 1 TO 47." I welcome a correction on how to fix this.
[ reply | up ]

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