Add utility methods for inexact ceil/floor binary searches.

This change also fixes issue #5