Skip to content

decimal_to_binary() should return identical values as bin() #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cclauss opened this issue Aug 1, 2019 · 3 comments · Fixed by #1093
Closed

decimal_to_binary() should return identical values as bin() #1090

cclauss opened this issue Aug 1, 2019 · 3 comments · Fixed by #1093

Comments

@cclauss
Copy link
Member

cclauss commented Aug 1, 2019

def decimal_to_binary(num):

Please change decimal_to_binary() to return identical values as the Python builtin bin(). With doctests to prove it please.

@PatOnTheBack @Corruption13

@cclauss cclauss changed the title decimal_to_binary() should return identical values as the Python builtin bin() decimal_to_binary() should return identical values as bin() Aug 1, 2019
@syedwaleedhyder
Copy link
Contributor

Give an example of a decimal number for which decimal_to_binary(num) is inconsistent.

@cclauss
Copy link
Member Author

cclauss commented Aug 1, 2019

0b is missing

@syedwaleedhyder
Copy link
Contributor

I have created a pull request(#1093).
The new code can handle ZERO and negative numbers too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants