Module int_bisect

Module int_bisect 

Source
Expand description

Contains an implementation of the bisection method for computing roots, but working with integers only.

Functionsยง

bisect_floor
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.
find_root_floor
Given a function f with lim_{x -> -inf} f(x) = -inf and lim_{x -> inf} f(x) = inf, finds some integer n such that f(n) <= 0 and f(n + 1) > 0.
root_floor
Computes the largest integer x such that x^root <= n, where n is a positive integer.