Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

...Huge Division

Name: n3n7i 2011-08-18 3:00


//----------------------------------


void ThousandFold(int xa[]){
int i=0, Top = xa[RRay];
if(Top==RRay){ printf("\nTF MAX!!\n"); return;}
for(i=Top;i>=0;i--){
    xa[i+1] = xa[i];
    //print()
    }
xa[0]=0;
xa[RRay]++;
}
   

//---------------------------------------------------

void TSDivide(int xa[], int xb[], int xc[]){
int mCount[102],
     VSub[102], VCount[102], TCount[102], OVC[102], OVM[102];

int GetRays=0, ThouLoop=0;

Set(VSub, xa);
Set(VCount, xb);
One(mCount);
Zero(TCount);

while(isLarger(VSub, VCount)>0){   
   
    /*printf("VS");
    Printout(VSub);
    printf("VC");
    Printout(VCount);
    Pause();
    */

    while(isLarger(VSub, VCount)>=0){
        Set(OVC, VCount);
        Set(OVM, mCount);
        ThousandFold(VCount);
        ThousandFold(mCount);
       
        /*//ThouLoop = isLarger(VSub, VCount);
        printf("MC");
        Printout(mCount);
        printf("VC");
        Printout(VCount);
        Pause();
        //GetRays++;
        */
        }
    Set(VCount, OVC);
    Set(mCount, OVM);
   
    //GetRays--;
   
    while(isLarger(VSub, VCount)>=0){
        Set(OVC, VCount);
        Set(OVM, mCount);
        Add(VCount, VCount, VCount);
        Add(mCount, mCount, mCount);

        /*printf("MC");
        Printout(mCount);
        printf("VC");
        Printout(VCount);
        Pause();
        */

        }
   
    /*printf("VS");
    Printout(VSub);
    printf("Minus OVC");
    Printout(OVC);


    printf("TC");
    Printout(TCount);
    printf("Plus OVM");
    Printout(OVM);
    Pause();
    */   

    Sub(VSub, OVC, VSub);
    Add(OVM, TCount, TCount);

    Set(VCount, xb);
    One(mCount);

    /*printf("VS");
    Printout(VSub);
    printf("TC");
    Printout(TCount);
    Pause();

    */
    }


if(isLarger(VSub, VCount)==0){   
    Add(aOne, TCount, TCount);
    Sub(VSub, VCount, VSub);
    }

printf("\n\nDivide ");
Printout(TCount);
printf("Remainder ");
Printout(VSub);

Set(xc, TCount);
}

//---------------------------------------------------

Name: n3n7i 2011-08-18 21:49

...Meanwhile, n3n7i has just stumbled across the holy grail of fast arithmatic =)

...My variables are noble, hence they have titles ;)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List