Real Close to the Machine: Floating Point in D

Lu’ís Marques luismarques at gmail.com
Tue May 12 11:41:04 PDT 2009


> A naive binary chop doesn't work correctly. The fact that there are hundreds or thousands of times as many representable numbers between 0 and 1, as there are between 1 and 2, is problematic for divide-and-conquer algorithms. A naive binary chop would divide the interval [0 .. 2] into [0 .. 1] and [1 .. 2]. Unfortunately, this is not a true binary chop, because the interval [0 .. 1] contains more than 99% of the representable numbers from the original interval!

How about adding a template to do a binary chop (binary search?) to 
std.algorithm?



More information about the Digitalmars-d mailing list