in reply to Re: Finding all divisors of an integer
in thread Finding all divisors of an integer
@divisors = grep { $number % $_ == 0 } 1 .. sqrt($number);
I think you are thinking of prime factorization here. You can stop there to determine primeness but not to determine all factors.
Cheers - L~R
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Finding all divisors of an integer
by Sidhekin (Priest) on Jul 03, 2004 at 14:16 UTC | |
| |
A reply falls below the community's threshold of quality. You may see it by logging in. |