小编saa*_*531的帖子

如何将二进制数转换为整数而不使其为正数

我需要一个函数,将二进制符号转换为整数.

int("1010",2) 
#this will be converted to 10 instead of -6 - 
# i want a fucnction that will convert it into -6 
Run Code Online (Sandbox Code Playgroud)

python binary

3
推荐指数
1
解决办法
266
查看次数

标签 统计

binary ×1

python ×1