What would you expect ones_complement(1100) to return? (I'm guessing you'd expect a Python int with value 11.) What about ones_complement(11111100)? (I'm guessing that you'd also expect a Python int with value 11 here.) What would ones_complement(ones_complement(1100)) be? What would ones_complement(ones_complement(11111100)) be? .... we can use 0b1100 instead of 1100.Then the output of binary.twos_complement(0b1100) will be 0b0100 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/KUUBDU4DLOC7OEGXFAK6P2LOOGJLWCAP/ Code of Conduct: http://python.org/psf/codeofconduct/
- [Python-ideas] Add Binary module. ananthakrishnan15 . 2001
- [Python-ideas] Re: Add Binary module. Mark Dickinson
- [Python-ideas] Re: Add Binary module. Antoine Rozo
- [Python-ideas] Re: Add Binary module. ananthakrishnan15 . 2001
- [Python-ideas] Re: Add Binary module... Mark Dickinson
- [Python-ideas] Re: Add Binary mo... ananthakrishnan15 . 2001
- [Python-ideas] Re: Add Bina... Serhiy Storchaka
- [Python-ideas] Re: Add ... ananthakrishnan15 . 2001
- [Python-ideas] Re: Add Bina... Mark Dickinson
- [Python-ideas] Re: Add ... ananthakrishnan15 . 2001
- [Python-ideas] Re: ... Mark Dickinson
- [Python-ideas] Re: ... ananthakrishnan15 . 2001
- [Python-ideas] Re: ... Mark Dickinson
- [Python-ideas] Re: ... ananthakrishnan15 . 2001
- [Python-ideas] Re: ... Chris Angelico
- [Python-ideas] Re: ... ananthan ananthan
- [Python-ideas] Re: ... ananthan ananthan
- [Python-ideas] Re: ... Barry Scott
- [Python-ideas] Re: Add Binary mo... ananthakrishnan15 . 2001
- [Python-ideas] Re: Add Binary mo... ananthakrishnan15 . 2001