diff --git a/curriculum/challenges/english/blocks/lecture-numbers-and-mathematical-operations/67fe859e9d3b3635197781c8.md b/curriculum/challenges/english/blocks/lecture-numbers-and-mathematical-operations/67fe859e9d3b3635197781c8.md index 1a95e4a3baf..36515853649 100644 --- a/curriculum/challenges/english/blocks/lecture-numbers-and-mathematical-operations/67fe859e9d3b3635197781c8.md +++ b/curriculum/challenges/english/blocks/lecture-numbers-and-mathematical-operations/67fe859e9d3b3635197781c8.md @@ -178,6 +178,12 @@ print('Integer Exponentiation:', exp_ints) # Integer Exponentiation: 95116601380 print('Float Exponentiation:', exp_floats) # Float Exponentiation: 614787626.1765089 ``` +Sometimes, you might notice that the result of an operation involving floats has more decimal digits than expected. For example, the sum `0.1 + 0.2` equals `0.30000000000000004` instead of `0.3`. + +This happens because numbers are stored in binary format, and some fractions cannot be represented exactly in binary. As a result, they are stored as finite approximations, in the same way the fraction `1/3` cannot be represented with a finite number of digits in decimal and is truncated after a certain number of its infinite digits (`0.33333...`). + +This leads to small rounding errors. + Python also provides built-in functions for converting either numeric data or strings into integers or floats. The `float()` function returns a floating-point number constructed from the given number: