2 ms·
Since you seem not to like Clooney, what about uwork? I wrote it a while ago: https://github.com/franciscop/uwork https://github.com/franciscop/uwork cons
by franciscop 7y ago
Since you seem not to like Clooney, what about uwork? I wrote it a while ago:
https://github.com/franciscop/uwork https://github.com/franciscop/uwork
const findPi = uwork((iterations = 10000) => {
let inside = 0;
for (var i = 0; i < iterations; i++) {
let x = Math.random(), y = Math.random();
if (x * x + y * y <= 1) inside++;
}
return 4 * inside / iterations;
});
// Run this inside an async context:
const pi = await findPi(200000000);