i know this post is old, but i have the exact same problem that i am working on.. i need to divide 2^512 +1 by another 49 digit number, but so far only got 2 by 2 digits working.. anyone got any ideas?

Code:

// need to add for loops for array a
#include <iostream.h>
int main()
{
const int sizea = 2;
const int sizeb = 2;
int a[sizea] = { 5, 7 };
int b[sizeb] = { 2, 5 };
int counter[sizea] = { 0 };
int remainder = 0;
// for (int i = 0; i < sizea; i+=sizeb)
for (int i = 0; i < sizea; i++)
{
// Do division (if necessary)
int count = 0;
while (a[i] >= b[i])
{
if (a[(i+1)] < b[(i+1)])
{
a[i] = a[i] - 1;
a[(i+1)] = a[(i+1)] + 10;
}
if (a[i]>=b[i])
{
a[i] -= b[i];
a[i + 1] -= b[i + 1];
++count;
}
}
counter[i + 1] = count;
// Handle remainder
if (a[i]==0)
{
remainder += a[i + 1];
a[i] = 0;
}
else
{
a[i + 1] = ( a[i] * 10 ) + a[i + 1];
remainder = a[i + 1];
a[i] = 0;
}
}
// Output
for (int j = 0; j < sizea; ++j)
{
cout << counter[j];
}
cout << " remainder " << remainder << endl;
return 0;
}