Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
This tag is for challenges involving the mathematical constant pi, the ratio of a circle's circumference to its diameter.
5
votes
Output Pi without math
bash -- 39
We all know that the first few digits of Pi can be computed from the following statement:
May I have a large container of coffee
We need only 2 decimal places, right? …
4
votes
π Day puzzle for 3/14
Use OCaml to compute Pi
awk to calculate Pi*r2
Here it is:
ocaml <<< "4.0 *. atan 1.0;;" | awk '/float/{printf("%.12f", 3*3*$NF)}'
The answer is:
28.274333882308 …
3
votes
π Day puzzle for 3/14
R + grep + awk + dc
echo pi | R --no-save --quiet | grep -v '^>' | awk '{print $2}' | dc -e '?3 3 **p'
Output:
28.274337 …