Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Finding all divisors of an integer

by Anonymous Monk
on Jul 05, 2010 at 23:12 UTC ( [id://848128]=note: print w/replies, xml ) Need Help??


in reply to Re: Finding all divisors of an integer
in thread Finding all divisors of an integer

oi? Newbie programer here.. dividing the number for primefactorization? sounds like this subroutine i cooked up to do my homework...
sub primefactor ($) { my $number=shift; my @factors=(); for (my $i=2; $i<=$number;) { unless ($number%$i) { $number/=$i; push @factors, $i; } else {$i++} } @factors&&return(@factors); return($number); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-03-28 16:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found