0
>>> from math import ceil
>>> a,b=314159265389793240,1
>>> print(f"a {a} b {b} {ceil(a/b)}")
a 314159265389793240 b 1 314159265389793216

Can someone explain why this overflow is occuring in python?
The value of a and ceil(a/b) should be same as b = 1.

  • What overflow? `/` is the real division (aka `float`) operator (there is a dupe for that) - you’ve explicitly asked Python to work with limited precision. – MisterMiyagi Nov 05 '22 at 07:28

0 Answers0