I need a reliable arbitrary-precision division of discrete real numbers (ℝ), using arbitrary-precision discrete integers (ℤ).
It is a classic problem, but it is not easy to verify the good solutions on the Web. I need a division algorithm to calculate $N/D$ with the following "real life" computational constraints:
The result can represented as "integer part" and "fractional part", that is ordinate pair $r=(i,f)$, or by a integer and a standard divisor like $10^n$.
The algorithm is a function $f(N,D)$ that use bitwise operations and/or basic arithmetic operations; and a fast function like $SRT(n_0,d_0)$, that returns the quotient $Q_0$ and the remainder $R_0$, so it returns the pair $(Q_0,R_0)$.
All values ($i,f,n_0,d_0,Q_0,R_0$) are arbitrary-precision discrete integers (example)... How to calculate? Are there optimized algorithms to do it?
In nowadays is commom to use floating-point arithmetic with a reasonable number of bits (e.g. 32)... And to ignore the precision problems. In general programming languages offer simgle and double precision, but no Quadruple-precision floating-point data type.
Related question this one have good clues, but no objective answer about best algorithms (to obtain "integer part" and "fraction part" from integer division).