You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-1339/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,9 @@ print(
27
27
```
28
28
29
29
Because the value of `ITEM_COST` (0.33) cannot be precisely represented in Python due to its nature as a terminating decimal in base 10, the resulting output was as follows:
30
+
The unprecise `base 10` representation during the multiplication of `5` with `0.33` results in an `account balance` of `$1.34999999999999993` in the `noncompliant01.py` code.
30
31
32
+
**Example noncompliant01.py output:**
31
33
```text
32
34
5 items bought, $0.33 each. Current account balance: $1.34999999999999993
0 commit comments