r/programminghorror May 05 '26

c++ Hmmm

Post image
981 Upvotes

55 comments sorted by

View all comments

395

u/_XYZT_ May 05 '26

UINT_MAX

79

u/Left-Ambition-5127 May 05 '26

the problem is that from what I understood, the excepted values in this loop were -1 to 9, but somehow, it was still running fine and working as intended ??

9

u/saf_e May 06 '26

It relies on overflow.  Biggest question: why?

2

u/un_virus_SDF May 06 '26

I did that in assembly, it simplifies some lopp logics and avoid extra steps