Closed
Description
The ndarray
implementation of divmod
seems to do some incorrect rounding:
# regular python
divmod(78*6e-8, 6e-8)
# (77.0, 5.999999999999965e-08)
# makes sense; cannot represent number precisely as float
import numpy as np
np.__version__
# '1.10.0.dev0+00f4fae'
divmod(np.array(78*6e-8), 6e-8)
# (78.0, 5.9999999999999651e-08)
# Oops!!
divmod(np.arange(77, 80)*6e-8, 6e-8)
# (array([ 77., 78., 79.]),
# array([ 2.24993127e-22, 6.00000000e-08, 6.00000000e-08]))