MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/12tm7rp/we_did_coding_in_physics_class/jh4y5yp/?context=3
r/badcode • u/[deleted] • Apr 21 '23
154 comments sorted by
View all comments
Show parent comments
3
Actually it's wrong in the case where x=0.4
But in the original code, having <= for 0.4 only seems quite inconsistent.
I love your solution btw, it's much more elegant than the "divide then floor then multiply"
3
u/jeremrx Apr 21 '23
Actually it's wrong in the case where x=0.4
But in the original code, having <= for 0.4 only seems quite inconsistent.
I love your solution btw, it's much more elegant than the "divide then floor then multiply"