FYI: I learned this today:
Code: Select all
if 66.3 == round(66.30001, 1):
print("Rounding is fine")
print("This should not print 66.30001 on Pico but it does:", 66.3)
FYI: I learned this today:
Code: Select all
if 66.3 == round(66.30001, 1):
print("Rounding is fine")
print("This should not print 66.30001 on Pico but it does:", 66.3)
Given the infinity (aleph one) of reals between 0 and 1 that is very truescruss wrote: ↑Wed Jan 19, 2022 4:26 pm...
If you think about it, in 32 bits, there are of the order of 2^32 (roughly 4.3 * 10^9) distinct values you can store. And yet, we somehow manage to jam the number range of roughly +/- 10^38 into those 32 bits. So there must be some (quite a lot, actually) of numbers we can't represent as a float...