Simple Binary Converter
Author: Shawn Modersohn
Probably 2016-2017
License: Creative Commons V4
Scope:
This was initially an assignment for an introductory programming class. Take a whole number as input and represent that number as binary. The original version used the pow method to determine the 1's and 0's placement. Years later I revisited this and realized the algorithm could be much more simple. Recursively divide the number by two and check for a remainder to place 1's and 0's. This works because an integer divided by two will eventually become less than one, and rounded to 0 as a function of the integer data type.