Perl: the Markov chain saw | |
PerlMonks |
Find if a number is a multiple of a number.by Baratski (Acolyte) |
on Mar 02, 2005 at 12:29 UTC ( [id://435792]=perlquestion: print w/replies, xml ) | Need Help?? |
Baratski has asked for the wisdom of the Perl Monks concerning the following question:
Hello.
Is there a better way, other than my following example, to find if a number is a multiple of a number? My klunky way would be to keep subtracting x from y and look for a zero value. This seems like a long haul if I have to keep subtracting say, 4 from 123456789, or something like that.
Is there a better way? Thank you.
Back to
Seekers of Perl Wisdom
|
|