Home Up Run First Loop 
This Page Format is Obsolete!  Go to new site :

This Site will go away in spring of 2016:  Please visit to see NEW SITE!


Run First Loop

series 2 pure


Iteration and Higher mathematics


This Page Format is Obsolete!  Go to new site :

This Site will go away in spring of 2016:  Please visit to see NEW SITE!





Mathematics. A computational procedure in which a cycle of operations is repeated, often to approximate the desired result more closely.

Computer Science.

  1. The process of repeating a set of instructions mamy times or until a specific result is achieved.
  2. A cycle of a set of instructions to be repeated: After ten iterations, the program exited the loop.

Mathematics Application:

Algebra - In algebra you learned to solve equations for X. Your teacher may have told you to check your answer by substituting that number into the equation.  If your answer resulted in a equality, you can be certain that your answer was correct.  With a computer you can skip solving the equation and simply search for the solution by testing every number in a finite set of numbers.  For example, if you knew that X was an Integer between -1000 and +1000 you would have to do 2000 iteration to find all the solution.  Programmers use looping to perform repetitive operations.

Calculus - We use calculus to calculate the area under a curve of continuous function of x.  We can approximate the area under a curve with a number of rectangles with height f(x) and width of delta x).  The smaller the value of delta x the greater the number rectangles required cover the bounded area.  One iteration or loop is required to calculate area of each rectangle.  


JavaScript Methods of Looping - Before doing any physics or electronics calculations let us consider some methods of looping.  

Warning: Infinite Loops can hang up your computer.  Pressing Ctrl/Alt/Delete buttons simultaneously will interrupt program operation and cause Windows Task Manager Menu to be displayed.  Use  Windows Task Manager  -  End Task button to stop your program.

For Keyword

The for loop uses an index counter to keep track of the number loops, and stops looping when a certain number is reached.


<TITLE>Simple Script 1</TITLE>
n = 10
for (i = 1; i < 8; i++){
n = n *n; 
alert("n = "+n)
alert("The End")

i = 1 is start count.
 i < 8 defines upper limit
i++ means i = i + 1 or simply increment i.

Statements in parenthesis ( ) control loop.
Statements in wiggly parenthesis {} are operations to be performed in each loop. 






Questions or problems regarding this web site should be directed to

Copyright ©2003 Science Ebooks All rights reserved.
Last modified: Monday January 18, 2016.