-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Description
Bug report
Bug description:
I Write a code with large numbers( 10**18<n ) and I have understand that python in large numbers can't divide well.
for example:
n = 123140801928338636
print(n) # 123140801928338636
print(n/2) # 6.157040096416932e+16
print(int(n/2)) # 61570400964169320
from math import floor, ceil
print(floor(n/2)) # 61570400964169320
print(ceil(n/2)) # 61570400964169320
print(int(n/2)*2 == n) # False
this bug can create security bugs in products.
CPython versions tested on:
3.12
Operating systems tested on:
Linux, Windows
Metadata
Metadata
Assignees
Labels
No labels