I wrote simple code like this

----------------------
a = 0.2

for i in 1:10
  println(a * i)
end
---------------------------


and what I got is not 0.2, 0.4, 0.6, 0.8, 1.0 .... 

but this.

0.2
0.4
0.6000000000000001
0.8
1.0
1.2000000000000002
1.4000000000000001
1.6
1.8
2.0



println(0.2 * 3) does the same thing. not 0.6 but 0.6000000000000001

does anyone know why this happens? 

Reply via email to