Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Modulus Inconsistencies (Or Calling all Mathematicians)

by dragonchild (Archbishop)
on Mar 26, 2003 at 16:50 UTC ( [id://245993]=note: print w/replies, xml ) Need Help??


in reply to Modulus Inconsistencies (Or Calling all Mathematicians)

By the 8th grade definition of modulus, C is closer to being wrong (or Perl is more right). Modulus is usually a number in the range 0 .. ($n-1). However, it isn't "wrong" to be in the range (1 - $n) .. 0. It's just not the way most people think about it. (Kinda like saying 10/20 instead of 1/2 ...)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-28 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found