Re: [sqlite] Igor's Equation

2009-10-12 Thread Rick Ratchford
What I'm missing is a stiff drink.

Ouy!

I really bumbled this easy task. My one allowance this month, eh?

Cheers!
 
Rick 

#>-Original Message-
#>From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
#>boun...@sqlite.org] On Behalf Of Jean-Christophe Deschamps
#>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 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



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Igor's Equation

2009-10-12 Thread Rick Ratchford
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.. So . 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


Re: [sqlite] Igor's Equation

2009-10-12 Thread Jean-Christophe Deschamps

´¯¯¯
>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


Re: [sqlite] Igor's Equation

2009-10-12 Thread Igor Tandetnik
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 misinterpret the %. I understand how it works. :-)
> 
> 1400 % 1300 = .0769231

You very obviously don't. 1400 % 1300 == 100

> That's the remainder value of a 1400 / 1300 division.

No it's not. http://en.wikipedia.org/wiki/Remainder

> So what am I missing?

With all due respect, pretty much everything.

Igor Tandetnik


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Igor's Equation

2009-10-12 Thread Pavel Ivanov
> 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
 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


Re: [sqlite] Igor's Equation

2009-10-12 Thread 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. :-)

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