New submission from SonokoMizuki:
Add support of negative number in bin().
Currently, bin(-5) returns '-0b101', It is not intuitive.
I think bin() should return two's complement.
I suggest new bin().
New second argument is bit size.
if first argument is negative number and bi
SonokoMizuki added the comment:
It is nice solution. I can get negative number all right. thanks
but, I feel bad that bin(-5) returns '-0b101'
sorry
--
___
Python tracker
<http://bugs.python.o
SonokoMizuki added the comment:
That's right. currently python can not distinguish positive number or negative
number.
>>> a = bin(-5,10)
>>> int(a,2)
1019
I think reason of ambiguity is decode function( int() ).
So, I suggest new decode function.
(example)
>>
SonokoMizuki added the comment:
I see.
I grasp to write own function is best.
thanks (^-^)
--
___
Python tracker
<http://bugs.python.org/issue25999>
___
___
Pytho
Changes by SonokoMizuki :
--
title: Add support of native number in bin() -> Add support of negative number
in bin()
___
Python tracker
<http://bugs.python.org/issu