Got nothing to do during math class? Then let your calculator calculate Pi! The Leibniz formula states that:
Pi/4 = 1/1 – 1/3 + 1/5 – 1/7 + 1/9
This is how to do it on your TI calculator, nicely formated.
: 0 -> N : 0 -> P : ClrHome : Output( 1, 1, "STEP " ) : Output( 2, 3, "PI= " ) : While 1 : 1 / ( (-1)^N(2N+1) ) + P -> P : Output( 1, 6, N ) : Output( 2, 6, 4P ) : N + 1 -> N : End
Note that this is a very poor way of calculating Pi, especially with a calculator, since it requires an extremely large amount of steps in order to obtain accurate values. 10,000,000,000 operations are required in order to get only ten correct decimals.