next up previous contents index
Next: CommandLine Up: BinarySearch Previous: BinarySearch   Contents   Index


binarySearch


Usage

binarySearch(s, f, a, b)


Signature

binarySearch: (S, R $\to$ S, R, R) $\to$ (Boolean, R)


Parameter Type Description
s S The value to search for
f R $\to$ S A monotonic increasing function
a R The left end of the interval to search
b R The right end of the interval to search


Returns

Returns (found?, r) such that $s = f(r)$ if found? is true. Otherwise, found? is false and:



Manuel Bronstein 2004-06-28