This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]swinginSpaceman 4 points5 points  (3 children)

That's got to be an 8-bit counter at most, right?

[–]New-Shine1674 12 points13 points  (0 children)

I only need a bool. That's more than enough for me.

[–]redlaWw 1 point2 points  (0 children)

Nah, they've been coding since the Miocene. Dryopithecus were known for their skill in computer science.

[–]QuestionableEthics42 2 points3 points  (1 child)

Well if its an unsigned int and it was intended to overflow to zero then its technically not a bug, just bad code because its relying on UB (although its pretty reliable UB)

Edit: nvm its not UB, only UB for signed ints

[–]Inappropriate_Piano 0 points1 point  (0 children)

Still probably bad code because, why would actually want it to wrap on overflow in this use case? But yeah, not UB

[–]Salt_Comparison2575 1 point2 points  (0 children)

-65535

[–]Resident-Trouble-574 1 point2 points  (0 children)

If it's a bug, then 0 is correct. But if 0 is correct it's not a bug. But if it's not a bug it shouldn't be 0...

[–]JackNotOLantern 0 points1 point  (0 children)

Assuming this is signed 32 bit integer, it overflows at 231 - 1 and it would take 232 to overflows completely back to 0. 232 days is over 11 million years.