Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-08-20 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (118 votes), past polls