[–] e0m 9y ago ↗ And a Tweet-length implementation: https://twitter.com/E0M/status/841673345791803392for(m=Math,r=a=>m.round(1e9*m.random()),g=(a,b)=>b?g(b,a%b):a,p=0,i=0;i<1e7;i++)if(1==g(r(),r()))p++;console.log(m.sqrt(6/(p/(1e7)))); [–] mrkgnao 9y ago ↗ That 6 is all I needed to see. :)
2 comments
[ 3.0 ms ] story [ 10.7 ms ] threadfor(m=Math,r=a=>m.round(1e9*m.random()),g=(a,b)=>b?g(b,a%b):a,p=0,i=0;i<1e7;i++)if(1==g(r(),r()))p++;console.log(m.sqrt(6/(p/(1e7))));