bisection

A JavaScript port of the bisection algorithm that is used in Python