Just another wrong implementation of Binary Search, http://algorithms.openmymind.net/search/binarysearch, see this: http://googleresearch.blogspot.com/2006/06/extra-extra-read-...
The potential "bug" you pointed out has nothing to do with the algorithm being taught, and is an implementation detail that's irrelevant for this application.
IEEE doubles only have a 52 bit mantissa, so you need to keep that array under 2^51 elements. Call it 2 quadrillion to be safe.