This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: int method works improperly
Type: Stage: resolved
Components: Versions: Python 3.8
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Riccardo La Marca, serhiy.storchaka, steven.daprano
Priority: normal Keywords:

Created on 2019-12-04 11:29 by Riccardo La Marca, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Code.png Riccardo La Marca, 2019-12-04 11:41
Messages (3)
msg357797 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-12-04 11:44
Please provide any details. What methods and why do you think they do not work properly.
msg357798 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2019-12-04 11:48
Hi Riccardo,

In the future, would you mind not posting screenshots of code or errors? Rather, copy and paste the text. That makes it easier for others to replicate the error, and also allows visually impaired and blind people using screen leaders.

Otherwise you force us to retype your code, which can introduce errors.

This is not a bug, it is normal and expected behaviour. You type the number "123456789012345678901234567890.76" but floats only have 64 bits of precision, so that becomes the float 1.2345678901234568e+29 which is *exactly* the whole number 123456789012345677877719597056 just as `int` reports.

So nothing to do with `int`, it is normal behaviour for floats.
msg357799 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2019-12-04 11:50
You can read more here:

https://docs.python.org/3/tutorial/floatingpoint.html

https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate
History
Date User Action Args
2022-04-11 14:59:23adminsetgithub: 83149
2019-12-04 13:10:03serhiy.storchakalinkissue38969 superseder
2019-12-04 11:50:58steven.dapranosetmessages: + msg357799
2019-12-04 11:48:27steven.dapranosetstatus: open -> closed

nosy: + steven.daprano
messages: + msg357798

resolution: not a bug
stage: resolved
2019-12-04 11:44:41serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg357797
2019-12-04 11:41:44Riccardo La Marcasetfiles: + Code.png
2019-12-04 11:36:30Riccardo La Marcasetfiles: - Schermata 2019-12-04 alle 12.09.36.png
2019-12-04 11:29:11Riccardo La Marcacreate