Actually, my understanding of the Modulo was correct. The problem is that I suffered from a brain fart when going through the equation.
I well know that the Mod is the REMAINDER of the division. What I did wrong, mentally, was pull out my calculation, do a DIVISION, and then erroneously equate the fractional part of the answer as the remainder. For example: 7 mod 3 = 1 In my mental relapse, I did 7/3 = 2.3333. So .3333 was my remainder. See how stressed out I am. LOL!!! Sorry about my incorrect reply. Cheers! Rick #>-----Original Message----- #>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- #>boun...@sqlite.org] On Behalf Of Pavel Ivanov #>Sent: Monday, October 12, 2009 6:54 PM #>To: General Discussion of SQLite Database #>Subject: Re: [sqlite] Igor's Equation #> #>> 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 _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users