Monte Carlo methods: Difference between revisions

m
→‎{{header|REXX}}: updated the output.
m (→‎{{header|REXX}}: used a simplier comma function, added/changed whitespace and comments, expanded range of iterations.)
m (→‎{{header|REXX}}: updated the output.)
Line 1,916:
/*──────────────────────────────────────────────────────────────────────────────────────*/
comma: procedure; arg _; do k=length(_) to 1 by -3; _=insert(',',_,k); end; return _</lang>
'''{{out|output''' |text=&nbsp; when using the default inputsinput:}}
<pre>
1 2 3 4 5 6 7
scale: 1·234567890123456789012345678901234567890123456789012345678901234567890123
 
true pi= 3.141592653589793238462643383279502884197169399375105820974944592307816406+
 
10,000, repetitions: Monte Carlo pi is accurate to 3 places.
2050,000, repetitions: Monte Carlo pi is accurate to 4 places.
630850,000, repetitions: Monte Carlo pi is accurate to 5 places.
700890,000, repetitions: Monte Carlo pi is accurate to 76 places.
205,950130,000, repetitions: Monte Carlo pi is accurate to 87 places.
268,130620,000, repetitions: Monte Carlo pi is accurate to 108 places.
10,390,000, repetitions: Monte Carlo pi is accurate to 9 places.
Error 4 running "c:\montecpi.rex", line 18: Program interrupted
</pre>