Re: [Tutor] extreme basics

2009-01-05 Thread Alan Gauld
"Mr Gerard Kelly" wrote This is extremely weird, I think. No, its normal and you got the right reason its due to floating point binary representation issues. Here is a tiny program: from math import * from Numeric import * This is probably a bad idea here (in fact its usually a bad

Re: [Tutor] extreme basics

2009-01-05 Thread spir
Le Mon, 05 Jan 2009 17:59:06 +1000, Mr Gerard Kelly a écrit : > This is extremely weird, I think. > > Here is a tiny program: > > from math import * > from Numeric import * > > x=[0]*10 > > > for counter in rangelen((x)): > x[counter]=counter*0.1 > > print x > > Here is what I get: >

Re: [Tutor] extreme basics

2009-01-05 Thread A.T.Hofkamp
Mr Gerard Kelly wrote: This is extremely weird, I think. Here is a tiny program: from math import * from Numeric import * x=[0]*10 for counter in rangelen((x)): x[counter]=counter*0.1 print x Here is what I get: [0.0, 0.10001, 0.20001, 0.30004, 0.

[Tutor] extreme basics

2009-01-04 Thread Mr Gerard Kelly
This is extremely weird, I think. Here is a tiny program: from math import * from Numeric import * x=[0]*10 for counter in rangelen((x)): x[counter]=counter*0.1 print x Here is what I get: [0.0, 0.10001, 0.20001, 0.30004, 0.40002, 0.5, 0