return to top
source
Average of two natural numbers rounded toward zero.
Given natural numbers a < b such that p a = true and p b = false, bisect finds a natural number a ≤ c < b such that p c = true and p (c+1) = false.
a < b
p a = true
p b = false
bisect
a ≤ c < b
p c = true
p (c+1) = false