User Tools

Site Tools


user:thakes3:portfolio:php:pi

Table of Contents

Intro

Synopsis

This is the infinite series approximation of Pi

Overview

There are several key instruments that are used in this code.

  • A for loop handles the approximation
  • Math is handled iteratively through recursion.

Some things that are less apparent:

  • You don't need variable definitions to declare what data you are storing in a variable.
  • $result is being returned in plaintext on the page after generating the number
  • the “+” specified in the declaration of the $op variable is declaring the sign of the variable(positive).

Operators

“*” is used for multiplication “/” is used for division

user/thakes3/portfolio/php/pi.txt · Last modified: 2016/03/15 23:59 by thakes3