binsearch_closest: Use C++ style casting