 If the midpoint of the span is calculated as formula_18, then the value of formula_181 may exceed the range of integers of the data type used to store the midpoint, even if formula_12 and formula_14 are within the range.If "formula_12" and "formula_14" are nonnegative, this can be avoided by calculating the midpoint as formula_186.An infinite loop may occur if the exit conditions for the loop are not defined correctly.