Monte Carlo methods: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed to preferred spelling.)
m (→‎{{header|REXX}}: undid previous change.)
Line 1,529: Line 1,529:
end /*chunk*/
end /*chunk*/
reps=chunk*j /*calculate the number of repetitions. */
reps=chunk*j /*calculate the number of repetitions. */
_=compare(4*! / reps, pi) /*compare apples and ··· crab apples.*/
_=compare(4*! / reps, pi) /*compare apples and ··· crabapples. */
if _<=accur then iterate /*if not better accuracy, keep trukin'.*/
if _<=accur then iterate /*if not better accuracy, keep trukin'.*/
say right(commas(reps),20) @reps 'accurate to' _-1 "places." /*-1 for dec. pt.*/
say right(commas(reps),20) @reps 'accurate to' _-1 "places." /*-1 for dec. pt.*/