Is there any rule to determine how many decimal places a rational and integer number placed into the abstract, binary function of multiplication be truncated to if the output should be rounded to a given number of decimal places?
For example, given the following numbers and the constraint (if this is the correct termt to use here) of 'to two decimal places' $$120*pi = 276.9911184307... \approx 276.99$$ $pi$ can be truncated after the 5th digit to the right of the decimal place to get the same answer as if a much longer approximation of pi were used , i.e. $$120*3.141 = 276.92$$ $$120*3.1415 = 276.98$$ $$120*3.14159 = 276.9908 \approx 276.99$$
Including more digits is not necessary: $$120*3.141592 = 276.99104$$
Without performing the calculation by hand a number of times until the minimum number of truncation digits is arrived at, was there a way to know that in advance?
No$^2$, the problem is that when you know the (absolute or relative) error of the inputs, then you can estimate the error of the result. However, knowing the error of the result doesn't necessarily tell you how many digits are correct.
When performing calculations, one usually cares for the precision resp. error of the result. Caring for the number of correct digits will only be needed in cases where the result is to be displayed "nicely" for humans. Or in context of statements like: "These are the first digits of π."
The problem is basically that $0.\bar9 = 1$, but when calculating $1$ to 3 correct decimals, we usually wouldn't accept
0.999. We can request that no representation ends with infinitely many9's and make representation unique, but we still have that $0.\bar9 = 1$ and similar for all numbers that posess a finite expansion (except 0).When we calculate numbers with finite precision, this means that when the last calculated digits are all
0's or9's, then we cannot be sure that they are correct, because when computing the result ever so slightly more exact, that might flip all0's to9's or vice versa.For $x > 0$ let $x_d$ denote the $d$-th digit$^1$ of $x$, i.e. the digit with magnitude $10^d$. Then:
When the result is
...x_dwith $1\leqslant x_d\leqslant 8$ and if the error $\Delta x$ of the result satisfies $|\Delta x| < 10^d$, then all digits $x_k$ with $k\geqslant d+1$ are correct.When the result is
...000compute more digits until you find a digit $x_d\neq 0$. If the error $\Delta x$ of the result satisfies $|\Delta x| < 10^d$, then either case 1. applies, or $x_d = 9$ and all digits $x_k$ with $k\geqslant d+2$ are correct.When the result is
...999compute more digits until you find a digit $x_d\neq 9$. If the error $\Delta x$ of the result satisfies $|\Delta x| < 10^d$, then either case 1. applies, or $x_d = 0$ and all digits $x_k$ with $k\geqslant d+2$ are correct.This means that in order to have all digits of magnitude $10^d$ and higher correct, one needs an absolute error of $10^{d-1}$ or less. However, you don't know how deep the rabbit hole goes... There is no a-priori estimate how many digits will be correct. If the precision is not high enough to reach a conclusion, you'll have to re-compute everything with increased precision and hope for the best. The worst cases are numbers with a finite expansion when written in base $B$. This are all numbers of the form $z\cdot B^k$ with $k\in\Bbb Z$ and $z\in\Bbb Z^{\neq0}$.
$^1$All this generalizes in the obvious way to bases $B\neq10$. The annoying cases are 2. $x_d = 0$ and 3. $x_d = B-1$.
$^2$One notable exception are spigot type formulae like the Bailey-Borwein-Plouffe formula for $\pi$. These algorithms can calculate any requested digit without the knowledge of any other digit(s). The drawback is that these are only available for special numbers and cannot be used for general arithmetic. Second drawback is that they yield only digits for a specific base like $B=16$ in the case of BBP for $\pi$.