Help for this page

Select Code to Download


  1. or download this
        foreach my $i( reverse 1..$len){
            my $x = 10 * $a[$i-1] + $q * $i;
            $a[$i-1] = $x % (2 * $i - 1);
            $q = int($x / (2 * $i - 1));
        }
    
  2. or download this
        foreach my $i( reverse 0 .. $len-1){
            my $x = 10 * $a[$i] + $q * ($i+1);
    ...
            $a[$i] = $x % $divisor;
            $q = int($x / $divisor);
        }