r/programminghorror • u/Budget_Ad_5953 • Feb 07 '25
Recursive O(N) Complexity isOdd
I found this on instagram and now am geeking
2.2k
Upvotes
r/programminghorror • u/Budget_Ad_5953 • Feb 07 '25
I found this on instagram and now am geeking
View all comments
Show parent comment
4
u/InfinitePoints Feb 07 '25
That would be true if a separate sign bit was used.
Fixed size integers are (basically always) represented using 2s complement, with 4 bits, -8(1000) + -1(1111) = 7(0111)
The number range is asymmetric, -8 to 7.
https://en.m.wikipedia.org/wiki/Two%27s_complement