From: Joe H. <hea...@gm...> - 2008-03-30 13:36:00
|
Okay this is driving me crazy. Typing arange(0.1,0.4,0.1) should give [0.1, 0.2, 0.3] but instead it gives [0.1, 0.2, 0.3, 0.4]. Typing arange(0.1,0.5, 0.1) should give [0.1, 0.2, 0.3, 0.4] and it indeed does. Another example that doesn't give the "correct" result is arange(0.2,0.8,0.2), which gives [ 0.2, 0.4, 0.6, 0.8]. Is this a bug in the arange() code? I've tinkered with this for two days and there seems to be no way to predict when arange() will behave as documented. I have my students working on a small assignment that uses arange() and I don't want this to affect their work. Is there some detail I'm overlooking? Joe |