So i'm having a small issue that seems to arise when getting a negative value back (if the number isn't found in an array.) I'm instructed to essentially take the negative number of where it should be (which would be -7 if it belongs in the 7th index space) and make it a positive index number.
Here is the exact description:
// STEP #2 if the return value is negative then you realize that the number was not
// found in the array and this negative number is an encoded index of where the
// number belongs. You must "decode" this index back to the real index it represents.
// You do this by doing the opposite operations in the reverse order they were done in
// when bsearch "encoded" the index. Once you have a non negative index you can go to
// the next step.