Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

at first you should write yourself a couple of routines to do add, subtract, binary shift and so on for your array numbers..

here is a couple of them:

void add (unsigned char * sum, unsigned char *a, unsigned char *b)

{

// add two values

int carry = 0;

for ( int i=200; i; i--)

{

int c = (int)a[i-1] + (int)b[-1] + carry;

carry=0;

if ( c>256 ) carry = 1;

sum[i-1] = c&255;

}

}

void sub (unsigned char * sum, unsigned char *a, unsigned char *b)

{

// subtract two values

int carry = 0;

for ( int i=200; i; i--)

{

int c = (int)a[i-1] - (int)b[-1] - carry;

carry=0;

if ( c<0 ) carry = 1;

sum[i-1] = c&255;

}

}

void shift (unsigned char * val)

{

// shift by one to the right.

int carry = 0;

for ( int i=0; i<200; i++)

{

int oldcarry = carry;

if ( val[i]&1 ) carry = 1;

val[i]>>=1;

if ( oldcarry ) val[i]|=128;

}

}

the trick is, that you do it like you would calculate an addition on paper (you learned that in school I think).

you need a variable to hold the carry value since c doesn't have something like that.

when you want to do division follow the steps on this webpage:

http://hsc.csu.edu.au/compstud/courses/23unit/comptech/97/division.htm

they explain how to do division by using more simple arithmetic (say shifts and subracts).. the web page is really cool..

I hope this helps.. if not let me know..

(btw. i haven't checked the code I wrote, but I'm pretty sure it works.. don't flame me if I made a typo)

Nils