binary-search

Convenient and near-optimal binary search on floating point numbers

A near-optimal floating-point binary search template that searches representable values via bit-casts instead of hard-coded iteration counts.

Binary search and other "halving" methods

A beginner-friendly guide to binary search as partition-point search, including invariants, variants, language APIs, and optimizations.