Suppose I want to construct an array in Python/numpy using the r_ operator like so.
>>> import numpy as np
>>> np.r_[0.02:0.04:0.01]
array([ 0.02, 0.03])
>>> np.r_[0.04:0.06:0.01]
array([ 0.04, 0.05])
Both cases work as expected. If I change the limits though:
>>> np.r_[0.03:0.05:0.01] #?????
array([ 0.03, 0.04, 0.05])
Why does this happen? Is it something to do with an inexact floating point representations? Or is this a bug?