How can one extract the digits of a binary \ decimal number. For example i have 100110111 to need to extract them only using +,-,*,/ and MOD. I can only use this LOOP Language. Most of the algorithms use floor function with decimal numbers, but i have no clou how to implement floor with this.
2026-04-12 19:43:24.1776023004
Extract each digit of a binary \ decimal number
873 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
Although cumbersome, the following procedure can be employed to find out each digit. Maybe bounds on the while loops need to be adjusted $\pm1$.
$num = 100110111$
$count = 0$
$div = 10$
while $div\geq 10 \left\{\right.$
$\quad count = count +1$
$\quad div = num/10^{count}\left.\right\}$
initialize $digits$ array
$i = 0$
while $count\geq 0 \left\{\right.$
$\quad$ while $ num\geq 0 \left\{\right.$
$\quad \quad num = num - 10^{count +1}$
$\quad \quad dig[i] = dig[i]+1 \left.\right\}$
$\quad num = num + 10^{count +1}$
$\quad i = i +1$
$\quad count = count-1 \left.\right\}$