# Simple Number Theory Question

Lets say I have number in decimal form to the ten-thousands place $$p=0.abcd$$ and another number $$q=0.xyz$$ to the hundredth place. $$a.b,c,d,x,y,z$$ are all integers from 0 to 9, inclusive, except for z & d which can only range from 1 to 9, inclusive. If I want to know exactly where the decimal will lie in the multiplication of $$p*q$$ is there a formula I can employ?

Right now every time I multiply two decimals, I multiply $$abcd$$ and $$xyz$$ and then move the decimal point by the sum of number places d&z are away(so 7 moves to the eft). But this is all conditioned on the size of the number abcd*xyz yields. Is there a formula that can standardize this?

-

$p = 0.abcd = abcd \times 10^{-4}$
$q = 0.xyz = xyz \times 10^{-3}$

$pq = abcd \times xyz \times 10^{-7}$

So you'd always want to move it by 7 placed, regardless of how many digits $abcd\times xyz$ has.

You can see how to 'standardize this', but using the $10^{-n}$ to understand the decimal, as compared to integers.

-

You can write

$$p=\frac{abcd}{10000},\qquad q=\frac{xyz}{1000}$$

so

$$pq=\frac{abcd\cdot xyz}{10000000}$$

and the only cases where this eventually has less than seven decimal digits (after discarding trailing zeros) is when the product at the numerator ends with $0$, which is the case when either $d$ is $5$ and $z$ is even (or the other way around).

In fact a product of numbers not divisible by $10$ is divisible by $10$ if and only if one of them is divisible by $5$ and the other one by $2$. So take the maximum exponent $m$ by which one is divisible by $5$, the maximum exponent $n$ by which the other is divisible by $2$; set $k=\min\{m,n\}$; then exactly $k$ trailing zeros will appear in the product.

This phenomenon can never appear when the number base is prime, for example in binary arithmetic.

-