Re: Getting a grip on nested intervals and matrix encoding

From: creecode <creecode_at_gmail.com>
Date: Mon, 5 Jul 2010 13:38:22 -0700 (PDT)
Message-ID: <fe46ee69-c3ef-4423-a7b8-f8500ae930d6_at_w15g2000pro.googlegroups.com>


On Jul 5, 12:25 pm, Vadim Tropashko <vadim..._at_gmail.com> wrote:

> > SELECT 2 AS a11, 2 - MOD ( 3, 2 ) AS a12, 1 AS a21, 1 - MOD ( 2, 1 )
> > AS a22;
>
> > a11     a12     a21     a22
> > 2       1       1       1

> select MOD(2,1) from dual;
> MOD(2,1)
> ----------------------
> 0

Hello Vadim,

In MySql...

SELECT MOD ( 2, 1 ); MOD ( 2, 1 )



0

So MOD works OK.

My question was about the calculation of the last node in the ancestor chain...

SELECT 2 AS a11, 2 - MOD ( 3, 2 ) AS a12, 1 AS a21, 1 - MOD ( 2, 1 ) AS a22;

a11 a12 a21 a22



2 1 1 1

SELECT 1 - MOD ( 2, 1 ); 1 - MOD ( 2, 1 )



1

Since I want zero and not one for a22 of the root node I am assuming I need to special case the root node in my loop. I'm not clear whether the formula in your book was intended to calculate the root node matrix or not.

I'm just looking for validation that my assumption is correct and that I haven't screwed up somewhere.

Thank you,

Toodle-loooooooooooooo.................

creecode Received on Mon Jul 05 2010 - 22:38:22 CEST

Original text of this message