Background:
You have been given an assignment to convert base 10 numbers to base 2 without using any premade base conversion functions. You can't use any imported libraries either.
Problem:
Convert an input string from base 10 (decimal) to base 2 (binary). You may not use any premade base conversion code/functions/methods, or imported libraries. Since this is code-golf, the shortest answer in bytes will win.
Input will be anything from -32768 to 32767 (include sign byte handling in your code)
the MSB of signed variables controls if they are negative
- that sounds like sign bit, however as the range-32768..32767
suggests, you want 2's complement. So which do you want?.. \$\endgroup\$