1
The Do loop is somewhat similar to the Table command, where a definite range is given over which to carry out the commands. The While loop is more of a traditional loop, where a test is performed on each step.
In[1]:=
| 0 | 0.` |
| 1 | 0.8414709848078965` |
| 2 | 0.9092974268256817` |
| 3 | 0.1411200080598672` |
| 4 | -0.7568024953079282` |
| 5 | -0.9589242746631385` |
| 6 | -0.27941549819892586` |
| 7 | 0.6569865987187891` |
| 8 | 0.9893582466233818` |
| 9 | 0.4121184852417566` |
In[4]:=
| 0 | 0.` |
| 1 | 0.8414709848078965` |
| 2 | 0.9092974268256817` |
| 3 | 0.1411200080598672` |
| 4 | -0.7568024953079282` |
| 5 | -0.9589242746631385` |
| 6 | -0.27941549819892586` |
| 7 | 0.6569865987187891` |
| 8 | 0.9893582466233818` |
| 9 | 0.4121184852417566` |
| 10 | -0.5440211108893698` |
| Created by Mathematica (April 10, 2007) |