<?
$loop = 1000000; 
$count = 0;
for ($i=0; $i<$loop; $i++) {
  $x = rand() / getrandmax();
  $y = rand() / getrandmax();
  if(($x*$x) + ($y*$y)<=1) $count++;
}
echo .number_format($loop)..number_format($count)..($count/$loop*4);
?>