Pi Day: Functions For Including Pi In Your Code

6
Pi Day: Functions For Including Pi In Your Code


March 14 is often said to be Pi day, since the value of Π is 3.14 (if you express it to just two decimal places). While no rational Australian writes the date in the format 3/14, celebrate anyway with this reminder of the functions for accessing an approximate value of Π in different languages.

Pi picture from Shutterstock

Rosetta Code lists built-in mathematical functions across 83 languages, though not all those languages include Π as a built-in function. Math.Pi, anyone?

Real constants and functions [Rosetta Code]

Comments

Log in to comment on this story!