-1 days? (or 17, without the overflow)
Twos complement (invert the bits then add one), so its -15 days.
Otherwise 00000 and 10000 would paradoxically both equal 0 and make bitwise equality checks very difficult.
For anyone who doesn’t want to do the conversion, that’s 17 days.
Unless it’s a signed integer, then it’s -1 and they’re expecting something…
A 5 bit long signed integer? What kind of weird system you using ? :p
Because a 5 bit unsigned integer is so much better? :p
Or -15 days
what’s the general rule for translating negatives from binary? did you just do like 17 - 2 • (-1) or something?
I used what known as 2’s compliment. Take the complement (flip all the bits - here that would give you
01110
which is 14) then add 1.
They’ve never gone more than a month without an accident? Find a new work place immediately!
With a large enough workplace in the wrong industries it’s really easy to have something that could count against it.
I work in the LTL freight industry, we get quite a few.