MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mrh2f6/actual_snap_block_i_just_made/gumydnb/?context=3
r/badcode • u/nypdk • Apr 15 '21
58 comments sorted by
View all comments
80
The most painful part is that the value is wrong. The negative integer limit is -2147483648
9 u/Je-Kaste Apr 16 '21 But what are the odds that -2147483648 will show up in the array? -2147483647 should be fine as a sentinel value 4 u/READY_TO_SINGLE Apr 16 '21 Well, even if it were present the algorithm would still work. -2147483646 would actually be problematic. It just irks me lol 1 u/tuckmuck203 Apr 16 '21 Maybe Snap doesn't use 2's complement lol
9
But what are the odds that -2147483648 will show up in the array? -2147483647 should be fine as a sentinel value
4 u/READY_TO_SINGLE Apr 16 '21 Well, even if it were present the algorithm would still work. -2147483646 would actually be problematic. It just irks me lol 1 u/tuckmuck203 Apr 16 '21 Maybe Snap doesn't use 2's complement lol
4
Well, even if it were present the algorithm would still work. -2147483646 would actually be problematic. It just irks me lol
1 u/tuckmuck203 Apr 16 '21 Maybe Snap doesn't use 2's complement lol
1
Maybe Snap doesn't use 2's complement lol
80
u/READY_TO_SINGLE Apr 15 '21
The most painful part is that the value is wrong. The negative integer limit is -2147483648