If you use the known representation of double numbers, your program will work only on machines that use that representation. If you use the binary-search technique I suggested, it will run anywhere.
Admittedly the binary search is slower. What is it about this particular operation that you need to be able to do quickly?