Just looking to clear up what’s going on with the stupid long float here
The hint answer also has the same float even though 4.8 * 9 actually is equal to exactly 43.2.
Just looking to clear up what’s going on with the stupid long float here
The hint answer also has the same float even though 4.8 * 9 actually is equal to exactly 43.2.
Python has extensive documentation on this matter:
15. Floating Point Arithmetic: Issues and Limitations — Python 3.9.2 documentation
Floating-point numbers are represented in computer hardware as base 2 (binary) fractions. While humans use base 10 fractions. This can cause problems, as you have discovered