r/ProgrammerHumor • • Oct 06 '21

Don't be scared.. Math and Computing are friends..

Post image
65.8k Upvotes

2.4k comments sorted by

View all comments

Show parent comments

5

u/MinusPi1 Oct 06 '21

It's more like

for(int n = a; n <= b; n += 0.000000...01){...}

3

u/OrvilleTurtle Oct 06 '21

Yeah but then we get into the issue of binary math right? Computers don’t really do numbers like 0.00001 perfectly accurate which is fine except when you put it into a for loop.

5

u/MinusPi1 Oct 06 '21

Right, something like this wouldn't actually work in practice, just like an infinite sum, but it's the exact same analogy.