This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add leading zeros to a number | |
def zero_pad(target_length, input_string) | |
pad_length = target_length - input_string.length | |
"0" * pad_length + input | |
end | |
# convert a number to binary |