I am using the arange function to define my for loop iterations and getting unexpected results.
i = arange(7.8,8.4,0.05)
print i
yeilds the following:
[ 7.8 7.85 7.9 7.95 8. 8.05 8.1 8.15 8.2 8.25 8.3 8.35 8.4 ]
yet using the stop value of 8.35 as follows
i = arange(7.8,8.35,0.05)
yields the following
[ 7.8 7.85 7.9 7.95 8. 8.05 8.1 8.15 8.2 8.25 8.3 ]
But I want my range to end at 8.35! I know I can use the stop value of > 8.35 and < 8.4 to achieve my result, but why is it different and in my mind, inconsistent?
Edit: I am using version 2.7
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…