Binary Representation of an Integer
Implemented in Ruby and Java
Published in
4 min readJun 27, 2023
There will be many times in which you would like to convert an integer into its binary representation.
For example, the number 2
has the binary equivalent 10
. Or the number 4
is the binary number 100
. Or the number 47
is the binary 101111
.