Sent: Monday, October 12, 2009 7:12 PM
#>To: General Discussion of SQLite Database
#>Subject: Re: [sqlite] Igor's Equation
#>
#>
#>´¯¯¯
#>>So what am I missing?
#>`---
#>
#>The word 'Euclidean'. Stop dividing just before th
s-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
´¯¯¯
>So what am I missing?
`---
The word 'Euclidean'. Stop dividing just before the result gets
fractional and you're home.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Rick Ratchford 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.
> #>
>
> I didn't
> 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
#>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. :-)
Igor-
While your math works, I'm still puzzled as to how you came up with this.
((Month - StartMth)*100 + (Day - StartDay) + 1300) % 1300 <=
((EndMth - StartMth)* 100 + (EndDay - StartDay) + 1300) % 1300
With this...
((Month - StartMth)*100 + (Day - StartDay) + 1300) % 1300
The result will
7 matches
Mail list logo