in reply to Re: Illegal Modulus zero
in thread Illegal Modulus zero

From what I learned in school, modulo is simply defined as: $rest = $number - ($number/$modulo); That given, the error is perfectly justified when $module is 0.

According to PISA german schools are not the among the best anymore, but in this particular case, perl is with me. ;-)

Note: This doesn't take into account that perls modulo is an integer modulo.

Update:
oops. That should of course be (as ivancho states.): $rest = $number - (($number/$modulo) * $modulo);
Note to self: Don't post 5 minutes after waking up :-/


holli, /regexed monk/

Replies are listed 'Best First'.
Re^3: Illegal Modulus zero
by ivancho (Hermit) on May 21, 2005 at 05:11 UTC
    you missed a '* $modulo', methinks...
    Either that, or German schools have really gone downhill :-P