gotoken / math.sci.hokudai.ac.jp (GOTO Kentaro) writes:

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

> >It seems as if changing division so that 13/-4 -> -4 is a popular
> >option, perhaps keeping the current behavior as a new method. a%b
> >would then become a synonym for a.remainder(b).
> 
> But, I don't feel that Ruby's operators is not necessary to change; 
> their definitions are well reasonable.  

I guess it might just be me that was surprised to find that

    q, r = divmod(x, y)  =/=>  x = q*y + r

(where =/=> is a lame attempt at "does not imply"). In an ongoing
attempt to minimize the surprise function, I thought I'd raise the
issue.

However, if folks feel that this is the way it should be, that's fine
by me--I'll just document it that way.


Regards


Dave