#>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

Reply via email to