> 1400 % 1300 = .0769231 You're wrong with this. 1400 % 1300 = 1400 - (1400 / 1300) * 1300 = 1400 - 1 * 1300 = 100 So you have indeed misinterpreted the modulo operator http://en.wikipedia.org/wiki/Modulo_operation.
Pavel On Mon, Oct 12, 2009 at 7:49 PM, Rick Ratchford <r...@amazingaccuracy.com> wrote: > #>Hi Rick, > #> > #> > #>You seem to be misinterpreting the semantics of the % (modulo) operator. > #> > #> X % Y returns the (integral) remainder of the Euclidean division of > #>X by Y (both integers). > #> > #>Now things should be clearer. > #> > > Hi. > > I didn't misinterpret the %. I understand how it works. :-) > > If you have ((Month - StartMonth) * 100 + (Day - StartDay) + 1300) % 1300 > > Then... > > Say Month = 1 (Jan) and StartMonth = 1 (Jan) and Day = 10 and StartDay = 10. > > You have > > ((1 - 1) * 100 + (10 - 10) + 1300) % 1300 > > (0 * 100 + 0 + 1300) % 1300 > > (0 + 0 + 1300) % 1300 > > 1300 % 1300 = 0 > > Now we increment the Month. > > ((2 - 1) * 100 + (10 - 10) + 1300) % 1300 > > (1 * 100 + 0 + 1300) % 1300 > > (100 + 1300) % 1300 > > 1400 % 1300 = .0769231 > > That's the remainder value of a 1400 / 1300 division. > > That remainder is a fractional value below 1 as I had stated. > > > So what am I missing? > > Thanks. > > Rick > > > > > > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users