Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: porting C code to Perl -- solved

by soonix (Canon)
on Oct 23, 2017 at 18:41 UTC ( [id://1201919]=note: print w/replies, xml ) Need Help??

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);
        }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1201919]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-25 12:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found