nipy/dipy — pull request #494 by omarocegueda (2014-12-09 14:45:01+00:00)
Title: Fix round

This is a follow-up to #493.

Apparently, round is not defined in c++98:
http://stackoverflow.com/questions/485525/round-for-float-in-c

which causes this error:
http://nipy.bic.berkeley.edu/builders/dipy-py2.7-win32/builds/124/steps/shell_5/logs/stdio

Using floor(x+0.5) may not be consistent with numpy, we also need to consider rounding to nearest even:
http://mathematica.stackexchange.com/questions/2116/why-round-to-even-integers

This solution uses the same procedure as for "dpy_log2", by borrowing code from numpy:
https://github.com/numpy/numpy/blob/master/numpy/core/src/npymath/npy_math.c.src

The code now builds in buildbot dipy-py2.7-win32:
http://nipy.bic.berkeley.edu/builders/dipy-py2.7-win32/builds/127/steps/shell_5/logs/stdio