You could collapse most of that into print "$_\n" for grep { 0 == $no % $_ } @int;, if you wanted to. But I have my doubts whether this is reliable for large numbers, because you'll be comparing zero to a tiny floating-point number, which is usually a bad idea.What tiny floating-point numbers? '%' will always yield an integer, and since @int doesn't contain numbers exceeding $no, even $no/$_ for @int does not involve floats smaller than 1.
In reply to Re^2: First code - Factors
by JavaFan
in thread First code - Factors
by mabeuf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |