

Will make it produce also 0, which is wrong. You might say, well just assume that we are given two functions $f_1,f_2:\mathbb N\to\ And you should also specify how you want your output. Your problem is right there: how exactly will you give the infinite decimal expansions? We cannot talk about any algorithm if you are not specific on how you provide the input. "I want a general algorithm which given the decimal expansions of two numbers, finds the decimal expansion of their sum, difference, product, and quotient." In a comment to another answer you write: The moral of this story is that addition of infinite decimals is unpleasant in any situation where you want accurate algorithms. So you could never confidently output the digit just to the left of the decimal point of the answer. Even after reading millions of boring $9$'s and $0$'s, you'd still have the possibility that the first input could eventually have an $8$ or the second input could eventually have a $1$, making one of the two possible digits just to the left of the decimal point incorrect. If the inputs really are all $9$'s and all $0$'s after the decimal point, so either $1$ or $0$ could be digit just to the left of the decimal point, you can't actually give either of those (correct) answers after any finite amount of time.


Maybe you're patient enough to read millions of digits, but the situation can be even worse. So, to figure out the digit just to the left of the decimal point in the answer, you might need to read millions of digits of the input. On the other hand, if the first input has all $9$'s but the second has a $1$ after a few million $0$'s, then the digit just to the left of the decimal point of the answer has to be $1$, not $0$. Then the digit just to the left of the decimal point of the answer has to be $0$ not $1$. But suppose the $\dots$ in the input weren't so simple maybe the first one has an $8$ after a few million $9$'s while the second is (for simplicity) still all $0$'s. If the " $\dots$" means all $9$'s in the first case and all $0$'s in the second, then the sum is $1$, and there are two correct ways to write the answer, $1.000\dots$ and $0.9999\dots$, so the digit just to the left of the decimal point could be $1$ or $0$. To add two infinite decimals, I'd begin by setting aside an infinite amount of time, since I'd need that long just to read the input.įor a more reasonable algorithmic problem, suppose I just want to compute the first significant digit of the sum maybe that won't require reading the whole input.
