jmhodges/kdtree2 — pull request #2 by jrheller (2014-01-26 01:18:38+00:00)
Title: Update kdtree2.cpp

This fixes a bug that causes tree creation to fail for more than about one million points (for me, it failed when using 4004000 points). Using a single precision variable to sum this many points causes loss of precision (i.e., eventually all but the most significant one or two digits of each new value added to the sum are lost). The solution is to simply use a double precision float for the sum variable.