0

How do I convert a decimal value to a binary value in python given a second variable that gives the number of bits to use?

I am trying to write a function that accepts two arguments: a positive or negative decimal number and the number of bits to use in the excess representation. So far, I can make the conversion between decimal and binary given an integer, but I'm not sure how to implement the number of bits for its notation.

Any ideas?

4

0 回答 0