I have a fraction $\dfrac{a}{b}$ where $a$ and $b$ are both two large integers with $30$ digits each. I wish to approximate this fraction with a new fraction $\dfrac{c}{d}$ where $c$ and $d$ are both $10$-digit integers.
I came up with two ways:
- divide $a$ and $b$ repeatedly by $10$ until they both contain $10$ digits each.
- Get the decimal representation of $\dfrac{a}{b}$ and take the first $10$ digits. Divide this by $10^n$ where $n$ is the amount of digits in the first $10$ digits which come after the decimal point. So if the decimal representation is $125.65471263236454545654$ then the approximation is: $$\dfrac{1256547126}{10^7} = 125.6547126$$
Are both methods equivalent? Which one is better/more precise?