I had expected numpy's arange(start,end)
to produce values in the range [start,end]. The following example demonstrates that that's not always true (the final value is larger than end
):
import numpy as np
start=2e9
end=start+321
step=0.066833171999
x=np.arange(start,end,step=step)
print x[-1]>end # Prints "True"
print x[-1]-end # Prints 0.00013661384582519531
The error seems far too large to be caused by machine precision (but perhaps I'm thinking about it incorrectly). What's going on?
PS: I'm using Numpy version 1.10.1