If the function finds the value in the array, it will return the index of the element. If it does not find the value, it will return -1. For a large array, the statements in the loop will have to execute many times. The basic idea is that you divide the array into two subarrays, and compare the middle element to Value.
Value is equal to the middle element.
In this case, the element has been found and you are done. Value is greater than the middle element. Value is less than the middle element. In this case, if Value is in the array, it will be in one of the elements in the upper half of the array beyond the middle element. If Value is equal to the middle element, we are done.