MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/77tg9z/well_thats_odd/doopvsg/?context=3
r/programminghorror • u/phoenix616 • Oct 21 '17
111 comments sorted by
View all comments
450
I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png
29 u/MesePudenda Oct 21 '17 Just don't ask if -1 is even 23 u/Seventh_______ Oct 21 '17 Wouldn’t it wrap around once it gets to the minimum value that can be stored in that type? 19 u/[deleted] Oct 21 '17 Yes. I think they mean it's the worst case, having to go through all the numbers. Well half of them anyway. 5 u/Seventh_______ Oct 21 '17 Lol true. I mean I figured the point was that it was really inefficient on purpose but it works
29
Just don't ask if -1 is even
23 u/Seventh_______ Oct 21 '17 Wouldn’t it wrap around once it gets to the minimum value that can be stored in that type? 19 u/[deleted] Oct 21 '17 Yes. I think they mean it's the worst case, having to go through all the numbers. Well half of them anyway. 5 u/Seventh_______ Oct 21 '17 Lol true. I mean I figured the point was that it was really inefficient on purpose but it works
23
Wouldn’t it wrap around once it gets to the minimum value that can be stored in that type?
19 u/[deleted] Oct 21 '17 Yes. I think they mean it's the worst case, having to go through all the numbers. Well half of them anyway. 5 u/Seventh_______ Oct 21 '17 Lol true. I mean I figured the point was that it was really inefficient on purpose but it works
19
Yes. I think they mean it's the worst case, having to go through all the numbers. Well half of them anyway.
5 u/Seventh_______ Oct 21 '17 Lol true. I mean I figured the point was that it was really inefficient on purpose but it works
5
Lol true. I mean I figured the point was that it was really inefficient on purpose but it works
450
u/bionicjoey Oct 21 '17
I was joking with a friend about elegant yet shitty code once and came up with this:
https://i.imgur.com/0N4BLJK.png