Provided you already implemented multiplication, you can divide to an arbitrary number of digits of precision like this (written recursively and generally)
Code:
real divide( real numer, real denom, int ndigits )
{
real result = 0.0;
while( numer >= denom )
{
result += 1.0;
numer -= denom;
}
if( ndigit > 0 && numer != 0.0 )
return += 0.1 * divide( 10 * numer, denom, ndigits - 1 );
return result;
}
The use of 0.1 and 10 is arbitrary -- they simply have to be inverses of each other. It implies that the base used for ndigits is 10. You could use some other value, depending on your internal representation of the bignum. If you represent it in binary, a base of 2 is more natural, and these would reduce to single bit shifts (and ndigits would be expressed in bits instead of decimal digits)