Help for this page

Select Code to Download


  1. or download this
    $pi .= $predigit;    # <-- missing line
    
    print $pi =~ s/^03/3./r;
    
  2. or download this
    # The spigot algorithm for calculating the digits of Pi.
    # http://www.cut-the-knot.org/Curriculum/Algorithms/SpigotForPi.shtml
    ...
    
    print $pi, "\n";
    
  3. or download this
    2a3
    > use integer;
    ...
    ---
    >     $q    = $q / 10;