"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
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:
>
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.
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