Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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.

Comment on Re: 0 illegal modulus?

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 imbibing at the Monastery: (4)
As of 2015-11-29 09:14 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls