modulo,integer-division,cpu-speed,programming-pearls

The modulus/modulo operation is usually understood as the integer equivalent of the remainder operation - a side effect or counterpart to division. Except for some degenerate cases (where the divisor is a power of the operating base - i.e. a power of 2 for most number formats) this is just...

algorithm,binary-search,programming-pearls

If you have an array that is empty (n == 0), then a check of while(low + 1 != high) will only correctly terminate if low begins at -1 and high at 0. while((-1 + 1) != 0) //true If low began at 0 instead, or high began at -1...