bisect_floor

Function bisect_floor 

Source
pub fn bisect_floor<R, F>(ZZ: R, left: El<R>, right: El<R>, func: F) -> El<R>
where R: RingStore, R::Type: IntegerRing, F: FnMut(&El<R>) -> El<R>,
Expand description

Finds some integer left <= n < right such that f(n) <= 0 and f(n + 1) > 0, given that f(left) <= 0 and f(right) > 0.

If we consider a continuous extension of f to the real numbers, this means that the function finds floor(x) for some root x of f between left and right.