0.1 cannot be represented exactly in floating point.
0.5 can be represented exactly. Why?
> Hi,
>
> I found that in ghci, I input
> [0.1,0.2..2]
> and run, I get a result of
>
> [0.1,0.2,0.30000000000000004,0.4000000000000001,0.5000000000000001,0.6000000000000001,0.7000000000000001,0.8,0.9,1.0,1.1,1.2000000000000002,1.3000000000000003,1.4000000000000004,1.5000000000000004,1.6000000000000005,1.7000000000000006,1.8000000000000007,1.9000000000000008,2.000000000000001]
>
> But, as you know, it is not the exact answer.
>
> So, I wonder if there is something I can do to achieve a better performance
> and get [0.1,0.2,0.3,0.4..] as the result.
>
> Thanks.
>
> _______________________________________________--
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
--
Regards,
KC
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners