Determine largest possible position for integers

135 Views Asked by At

I'm sorry if I'm not using the proper terminology but here's my question.

When two numbers are multiplied, the position of the largest number can only be at the position of the sum of their operands.

Example:

50 * 50 = position 2 + 2 = 4
50 * 50 = 2500
99 * 99 = position 2 + 2 = 4
99 * 99 = 9801

My question is if there's a similar rule for addition, as well as exponentiation relating to the position of the largest number of two operands.

This can be practical if I want to limit integers to a certain range in a calculator without having errors. For example I can limit two products to 32 max position if the display has at most 32 positions.

1

There are 1 best solutions below

2
On BEST ANSWER

If you add two numbers, you have at most a carry of $1$ into the place beyond the longest. So if you add a $4$ digit number to a $3$ digit number (or anything $4$ digits or less), you have at most a $5$ digit number. To see this (and to justify your rule), note that a $4$ digit number is at least $10^{4-1}$ and at most $10^4-1$. So adding two four digit numbers is less than or equal to $10^4-1+10^4-1=2\cdot 10^4-2=19998\lt 10^5 -1$ so it has at most $5$ digits. My example shows it can have $5$. You can make a similar argument for multiplication.