MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/q2lsax/dont_be_scared_math_and_computing_are_friends/hfmpbk7
r/ProgrammerHumor • u/yuva-krishna-memes • Oct 06 '21
2.4k comments sorted by
View all comments
Show parent comments
5
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.
3
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.
Right, something like this wouldn't actually work in practice, just like an infinite sum, but it's the exact same analogy.
5
u/MinusPi1 Oct 06 '21
It's more like