Equation for real number to binary conversion

61 Views Asked by At

A real number can be converted into binary as given in the attached figure. How can we represent this process using an equation?

The method of converting a real number to binary

1

There are 1 best solutions below

4
On BEST ANSWER

Let $x\in\mathbb{R}$ and $p>1$ be an integer. Is this what you are asking for (with $p=2$) $$x=\text{sign}(x)\,\sum_{k=-\infty}^{+\infty}\,{\Big(\left\lfloor p^{-k}\, |x|\right\rfloor\text{ mod }p\Big)}{p^k}\,?$$