Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor snippet: Statistical rounding #196

Open
satwikkansal opened this issue Apr 16, 2020 · 2 comments
Open

Minor snippet: Statistical rounding #196

satwikkansal opened this issue Apr 16, 2020 · 2 comments

Comments

@satwikkansal
Copy link
Owner

satwikkansal commented Apr 16, 2020

Definitely not a Python-related wtf, but nice to know anyways

>>> round(1.25, 1)
1.2
>>> round(1.35, 1)
1.4
>>> round(1.45) + round(1.55) == 3
True

https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants