diff options
author | 2021-05-23 16:42:14 +0100 | |
---|---|---|
committer | 2021-05-23 16:42:14 +0100 | |
commit | a830935a8a7a3f773d4e03e905e65153b8a40b5b (patch) | |
tree | 5f365d3e78f7e5f02b8724a045ec454e237f48a0 | |
parent | Merge pull request #1607 from python-discord/vcokltfre/chore/modmail-tag-update (diff) | |
parent | fix: Remove the extra 'as' in floats.md (diff) |
Merge pull request #1610 from python-discord/fix/float-tag-typo
Remove the extra 'as' in the floats tag
-rw-r--r-- | bot/resources/tags/floats.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bot/resources/tags/floats.md b/bot/resources/tags/floats.md index 7129b91bb..03fcd7268 100644 --- a/bot/resources/tags/floats.md +++ b/bot/resources/tags/floats.md @@ -5,7 +5,7 @@ You may have noticed that when doing arithmetic with floats in Python you someti 0.30000000000000004 ``` **Why this happens** -Internally your computer stores floats as as binary fractions. Many decimal values cannot be stored as exact binary fractions, which means an approximation has to be used. +Internally your computer stores floats as binary fractions. Many decimal values cannot be stored as exact binary fractions, which means an approximation has to be used. **How you can avoid this** You can use [math.isclose](https://docs.python.org/3/library/math.html#math.isclose) to check if two floats are close, or to get an exact decimal representation, you can use the [decimal](https://docs.python.org/3/library/decimal.html) or [fractions](https://docs.python.org/3/library/fractions.html) module. Here are some examples: |