I'm using the Table
command to generate a list of values:
FullForm /@ Table[10. - x, {x, 2.7, 2.8, .1}]
and I get the following result:
{7.3`,7.199999999999999`}
Why do I get 7.199999999999999'
instead of 7.2?
Moreover, if I try to calculate the Complement
of {7.2}
in this list, I get {7.2,7.3}
, which is not what I would expect. At the same time, using the Complement
option SameTest->(#1==#2&)
gets me {7.3}
.
This behavior is observed in Mathematica 7/8/9, and even on WolframAlpha.
P.S. I know that using Range[7.3,7.2,-0.1]
would be clearer, I'm just curious about the aforementioned problem.
Table
but rather with substraction. The question is why10.-(2.7+0.1)//FullForm
and10.-2.8//FullForm
produce different results. $\endgroup$InputForm[2.7+.1] Out[8]//InputForm= 2.8000000000000003
$\endgroup$