0%

python如何产生精确循环小数

如果想产生一个[0.01,0.02,…,1.00]的list:

1
2
3
4
5
NOTE: FOR python3 only.
np.arange(0.01,1.00,0.01) WRONG!
-> 0.01,0.02,0.03000000001,... Just an example
[i*0.01 for i in range(1,101)] WRONG!
[i/100 for i in range(1,101)] RIGHT!