Search notes:

Python: int

int is one of Python's three built-in numerical types, the other two being float and complex.
An int stores an integral number

Python 3: no minimum or maximum number

With Python 3, there is no maximum or minimum number that can be stored in an int:
>>> i =   12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
>>> print(i* 10**10 + 1234567890)
123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
The number of bits that are needed to store a value as int can be queried with bit_length():
>>> print(i.bit_length())
463
>>> zero = 0
>>> print(zero.bit_length())
o
>>> kb = 1024
>>> print(kb.bit_length())
11
>>> almost_kb = kb - 1
>>> print(almost_kb.bit_length())
10
See also

See also

sys.int_info
Other Built-in types such as float.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758204443, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/types/int/index(69): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78