Answers for "32-bit integer python"

6

check 32 or 64 bit python

import sys
sys.maxsize > 2**32 
# it should display True in case of 64bit and False in case of 32bit
Posted by: Guest on June-25-2020
1

binary number in python 32 bit

>>> '{:032b}'.format(100)
'00000000000000000000000001100100'
>>> '{:032b}'.format(8589934591)
'111111111111111111111111111111111'
>>> '{:032b}'.format(8589934591 + 1)
'1000000000000000000000000000000000'    # N.B. this is 33 digits long
Posted by: Guest on August-08-2020

Python Answers by Framework

Browse Popular Code Answers by Language