Is there a way to compute the binary representation of a decimal number, natively in Bash, without resorting to external programs such as bc
?
Example:
Suppose I have 5
in base 10: I want to obtain 101
in base 2.
Why using bc
is not an option: loop performance.