Floating point arithmetic has built-in problems as it’s based on a binary approximation of numbers.
There is a good explanation of this in the Python docs.
You can check out the decimal
module if you need more exact answers.
More Related Contents:
- Python3 how to define one length byte-string?(Solved)
- Function Arguments – Clarification
- how can i change from python2 http request code to python3 Requests [closed]
- Python NameError: name is not defined
- How can I specify the function type in my type hints?
- Pygame already installed; however, python terminal says “No module named ‘pygame’ ” (Ubuntu 20.04.1)
- Find column whose name contains a specific string
- Print new output on same line [duplicate]
- Image rotation while moving
- How do I detect if the mouse is hovering over a button? PyGame button class is not displaying the text or changing colour on hover
- pip or pip3 to install packages for Python 3?
- Get contents of a Tkinter Entry widget
- Why are str.count(”) and len(str) giving different output?
- What are good uses for Python3’s “Function Annotations”?
- PermissionError: [Errno 13] in Python
- How do you fix the “element not interactable” exception?
- Types that define `__eq__` are unhashable?
- Is there anything faster than dict()?
- Python print statement “Syntax Error: invalid syntax” [duplicate]
- Python 3 integer division [duplicate]
- How to avoid “Permission denied” when using pip with virtualenv
- Is super() broken in Python-2.x? [closed]
- How to read the last line of a file in Python? [duplicate]
- How to put comments in Django templates?
- ImportError: cannot import name ‘_ColumnEntity’ from ‘sqlalchemy.orm.query’
- How to write List of lists in csv file in python [duplicate]
- Change Icon For Tkinter Messagebox
- With “args” vs without “args” to pass arguments to a thread in Python
- How to make print() output UTF-8 in Python 3.0?
- Discord.py get user object from id/tag