Python Integers: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
 
Line 14: Line 14:
</syntaxhighlight>
</syntaxhighlight>


In Python 2, an integer was limited to 32 bits. In Python 3, integers can be any size:
In Python 2, an integer was limited to 32 bits. In Python 3, integers can arbitrarily large:


<syntaxhighlight lang='py'>
<syntaxhighlight lang='py'>

Latest revision as of 23:23, 15 May 2024

Internal

TODO

Overview

Whole numbers, expressed as numeric constants that do not contain a decimal point.

x = -20
type(x)
<class 'int'>

In Python 2, an integer was limited to 32 bits. In Python 3, integers can arbitrarily large:

>>> googol = 10**100
>>> googol
10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Bases

IPy Bases Page 26.

Organizatorium