BigInteger

Простые типы / Числа / Integer

import math

# Int: no upper limit, no BigInteger type
a1 = 2 ** 63 - 1
# a1 is 9223372036854775807
print(f"{a1 = }")

b = 255
c = 1000

a2 = a1 * c
# a2 is 9223372036854775807000
print(f"{a2 = }")
print(f"{type(a2) = }")

# Floor division: an exact int, rounded down
a3 = (a2 + c) // b
# a3 is 36170086419038336501
print(f"{a3 = }")

# True division gives a float: digits are lost
a4 = (a2 + c) / b
# a4 is 3.6170086419038335e+19
print(f"{a4 = }")

fact = math.factorial(30)
# fact is 265252859812191058636308480000000
print(f"{fact = }")