Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: 0 illegal modulus?

by Cybercosis (Monk)
on Jun 12, 2001 at 00:59 UTC ( #87649=note: print w/replies, xml ) Need Help??

in reply to 0 illegal modulus?

Well, had I designed the Perl interpreter (*chuckle*), I'd've made sure that mod 0 was illegal for consistancy with the assembly language on most (that I've dealt with) platforms. For instance, on the x86, the modulus is calculated by doing and I?DIV instruction, which leaves the remainder of the division (the modulus) in the appropriately sized register (AH, DX, or EDX). The brief upshot of this is that, since the modulus is actually calculated with a division, modulus 0 would give you a divide by 0 error. More of an explanation than a solution, really.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2016-10-25 10:33 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (316 votes). Check out past polls.