Monte Carlo methods: Difference between revisions
→{{header|jq}}: give pc to three decimal places
(→{{header|jq}}: give pc to three decimal places) |
|||
Line 1,515:
<lang jq>def lpad($len): tostring | ($len - length) as $l | (" " * $l)[:$l] + .;
def percent: "\(
def pi: 4* (1|atan);
Line 1,541:
Iterations -> Approx Pi -> Error
---------- ---------- ------
10 2.
100
1000 3.
10000 3.
100000 3.
1000000 3.
</pre>
|