[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:03780] Re: modulo and remainder

From: Dave Thomas <Dave@...>
Date: 2000-07-04 01:07:26 UTC
List: ruby-talk #3780
Tadayoshi Funaba <tadf@kt.rim.or.jp> writes:

> hello,
> 
> At 2000-07-04T02:33:08+0900 (2451729.23134JD),
> matz@netlab.co.jp (Yukihiro Matsumoto) wrote:
> 
> matz> |However, in the old scheme of things, these were different operators.
> matz> |
> matz> |Has the decision now been made to unify them?
> 
> matz> In short, yes.
> 
> I hope not.
> 
> I wrote a method jd_to_wday in date2.rb like this:
> 
>     def jd_to_wday(jd) (jd + 1) % 7 end

So is date2 now broken with 1.5.4?

Perhaps we need a method .modulo.

The problem then is with .divmod. If that returns a modulo, rather
than a remainder, then the q*y+r = x relation is broken. So then maybe 
we'd need to add .divrem too...

And so it goes. All this a day before the 16 freeze too.

If this change has broken existing libraries, my vote would be to
revert to the old behavior and let's dicuss this some more for 1.8.


Regards


Dave

In This Thread