From: Conrad Schneiker Date: 2000-07-06T17:25:45-05:00 Subject: [ruby-talk:03885] Re: modulo and remainder Hi, Judi Roy / Camile Hamel wrote: > ----- Original Message ----- > From: "Yukihiro Matsumoto" > To: "ruby-talk ML" > Sent: Monday, July 03, 2000 10:44 PM > Subject: [ruby-talk:03787] Re: modulo and remainder > > > Hi, > > > > In message "[ruby-talk:03779] Re: modulo and remainder" > > on 00/07/04, Tadayoshi Funaba writes: > > > > |I wrote a method jd_to_wday in date2.rb like this: > > | > > | def jd_to_wday(jd) (jd + 1) % 7 end > > | > > |It calculates the day of week of the given the Julian day number. > > |I used % and it must be modulo. So it works even if jd is -ve. > > > > > > > It reflects the author's weakpoint. Even if you don't need that > > (weakness in mathematical field?), I can't do the right thing without > > YOUR help. Enlighten me, please. > > > > matz. > > Hi, > > I'm very much a newbie programmer and don't pretend to be able to follow > most of the postings. > Am I right in assuming matz is looking for mathematical info on 'modulo' and > 'remainder' I'm somewhat puzzled about that. This was a fairly recent topic of discussion (within the last few weeks/months or so) where people presented a fair amount of information and argumentation on just this topic. I didn't realize that the implementation choice questions hadn't been settled. I was just reiterating a previously made remark from that discussion. -- Conrad Schneiker (This note is unofficial and subject to improvement without notice.)