Skip to content

Commit c4f3f51

Browse files
myterons19110
andauthored
Update docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-1339/README.md
Co-authored-by: Hubert Daniszewski <[email protected]> Signed-off-by: myteron <[email protected]>
1 parent af9104e commit c4f3f51

File tree

1 file changed

+1
-1
lines changed
  • docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-1339

1 file changed

+1
-1
lines changed

docs/Secure-Coding-Guide-for-Python/CWE-682/CWE-1339/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Avoid floating-point and use integers or the `decimal` module to ensure precisio
44

55
In Python, floating-point types are constrained by a fixed number of binary mantissa bits, typically allowing for around seven decimal digits of precision (24-bit values). Consequently, they are not well-suited for representing surds, such as `√7` or `π` with full accuracy. Additionally, due to their binary nature, floating-point types are incapable of exactly terminating decimals in base 10, such as 0.3, which has a repeating binary representation.
66

7-
To ensure precision in applications requiring high accuracy, ushc as in financial or banking computations, it is recommended to avoid using floating-point types. Instead, integers or more precise data types like the `Decimal`class should be employed.
7+
To ensure precision in applications requiring high accuracy, such as in financial or banking computations, it is recommended to avoid using floating-point types. Instead, integers or more precise data types like the `Decimal` class should be employed.
88

99
## Non-compliant Code Example
1010

0 commit comments

Comments
 (0)