Hi,

In message "[ruby-talk:03109] Is divmod dangerous?"
    on 00/06/06, Dave Thomas <Dave / thomases.com> writes:

|In Ruby, % is a true modulo operator, and a.remainder(b) is used to
|get the remainder.
|
|                         Ruby                   Python
|   a     b  |   a/b   a%b  a.remainder(b) |    a/b      a%b
|============|=============================|=================
|  13     4  |    3     1       1          |     3        1   
|  13    -4  |   -3    -3       1          |    -4       -3
| -13     4  |   -3     3      -1          |    -4        3
| -13    -4  |    3    -1      -1          |     3       -1
|
|Why do we care, you ask?

Ruby basicly follows R5RS of Scheme.  / works as quotient, % works as
modulo, remainder works as remainder.  And divmod returns array of
[quotient, modulo].  Maybe divrem should be defined.

If this behavior raises any confusion, I'd like to change iff
consensus is made.

							matz.