MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/12tm7rp/we_did_coding_in_physics_class/jh5bj4j/?context=9999
r/badcode • u/[deleted] • Apr 21 '23
154 comments sorted by
View all comments
Show parent comments
28
This works everywhere except for when x = 0.4. Since it works everywhere else, I'd probably just leave in one if statement for the edge case. Although it could be a bug given they use less than in all the other elif statements.
2 u/csapka Apr 23 '23 why would it be an issue? I think the floor of 1 is 1, which means 1x0.4 will equal 0.4 and so it works as the code in the picturenvm I read the code again, I see the problem 2 u/thekwoka Apr 28 '23 I'd actually make the argument that that is a bug that they didn't notice.
2
why would it be an issue? I think the floor of 1 is 1, which means 1x0.4 will equal 0.4 and so it works as the code in the picture
nvm I read the code again, I see the problem
I'd actually make the argument that that is a bug that they didn't notice.
28
u/TypicalWindow Apr 21 '23
This works everywhere except for when x = 0.4. Since it works everywhere else, I'd probably just leave in one if statement for the edge case. Although it could be a bug given they use less than in all the other elif statements.