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.

  • Comment on Re: Modulus Inconsistencies (Or Calling all Mathematicians)