[New-bugs-announce] [issue44034] Incorrect type casting of float into int
Backbench Family
report at bugs.python.org
Tue May 4 12:58:33 EDT 2021
New submission from Backbench Family <hbutt4319 at gmail.com>:
y = int(1.999999999999999) # fifteen decimal points
print(y)
1 # output is 1
y = int(1.9999999999999999) # sixteen decimal points
print(y)
2 # output is 2
It shows 1 when we type fifteen decimal whereas when we add sixteen decimal points the output becomes 2.
----------
components: Windows
messages: 392919
nosy: hbutt4319, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Incorrect type casting of float into int
type: compile error
versions: Python 3.6
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44034>
_______________________________________
More information about the New-bugs-announce
mailing list