# Decimal to integer

If we have a number $$x$$ such that $$0 \leq x \leq 1,$$ using only addition, subtraction, multiplication and division ops can we go from $$x$$ to $$1$$, without knowing what the original $$x$$ value is?

Example: Let $$x = 0.5,$$ we can reach $$1$$ by doing $$2 * x.$$ However, this only works for $$x = 0.5$$ and not other possible $$x$$ values such as $$0.2, 0.35$$ or $$0.87.$$

A basic solution is dividing $$x$$ by itself. Are there any other functions we can use such that $$f(x) = 1?$$

• The function "dividing by itself" is just the function $f(x)=1$ for $x>0.$ A function in not concerned with the way it is computed, only with the result. $f(x)=1$ is the most basic such function. – Thomas Andrews Sep 3 '19 at 20:42
• The ceiling function $f(x)=\lceil x\rceil$ works for the interval $0\lt x\leq 1$. – Andrew Chin Sep 3 '19 at 20:46
• Maybe $f(x)=x+(1-x)$ ? – Fareed Abi Farraj Sep 3 '19 at 20:51
• There are infinitely many: $x-x+1$ or $2x-2x+1$ or $3x-3x+1$ or ..., but I have the feeling that this kind of answer is not satisfying for you. – M. Winter Sep 3 '19 at 21:46
• @FareedAF ... of course if you already know $1$ you are done, so there would be no need to do $x+(1-x)$. – GEdgar Sep 3 '19 at 21:48

What if $$x=0$$? Then addition, subtraction, and multiplication can still only yield $$0$$ again. And division by $$0$$ is undefined. Therefore: starting with $$x=0$$ and using only addition, subtraction, multiplication, and division never yields the answer $$1$$.
• Why not $0+1=1$ ? – Fareed Abi Farraj Sep 3 '19 at 21:51
• If I do not know "1", then I cannot do $0+1$ of course. – GEdgar Sep 4 '19 at 0:06
It seems you did not recognize that multiplying $$0,5×2$$ you are also dividing $$\frac{x}{x}$$ since multiplying by $$2$$ is the same as dividing bei $$1/2$$, so in fact you have with your operations only $$\frac{x}{x}$$ so with $$0,35$$ you multiply by $$\frac{100}{35}$$.