SetPrecision
's manual says
When SetPrecision is used to increase the precision of a number, the
number is padded with zeros. The zeros are taken to be in base 2. In
base 10, the additional digits are usually not zeros.
In[30]:= SetPrecision[Table[x, {x, 0.1, 0.7, 0.1}], 20]
Out[30]= {0.10000000000000000555, 0.20000000000000001110, \
0.30000000000000004441, 0.40000000000000002220, \
0.50000000000000000000, 0.59999999999999997780, \
0.70000000000000006661}
this does not reach 0.7
In[26]:= Table[x, {x, SetPrecision[0.1, 30], SetPrecision[0.7, 30], SetPrecision[0.1, 30]}]
Out[26]= {0.100000000000000005551115123126, \
0.200000000000000011102230246252, 0.300000000000000016653345369377, \
0.400000000000000022204460492503, 0.500000000000000027755575615629, \
0.600000000000000033306690738755}
on the other hand:
In[6]:= Table[x, {x, 0.1`20, 0.7`20, 0.1`20}]
Out[6]= {0.10000000000000000000, 0.20000000000000000000, \
0.30000000000000000000, 0.40000000000000000000, \
0.50000000000000000000, 0.60000000000000000000, 0.70000000000000000000}
but
In[33]:= Table[x, {x, 0.1`30, 0.7`30, 0.1`30}]
Out[33]= {0.100000000000000000000000000000, \
0.200000000000000000000000000000, 0.300000000000000000000000000000, \
0.400000000000000000000000000000, 0.500000000000000000000000000000, \
0.600000000000000000000000000000}
but again
In[37]:= SetPrecision[Table[x, {x, 0.1, 0.7, 0.1}], 30]
Out[37]= {0.100000000000000005551115123126, \
0.200000000000000011102230246252, 0.300000000000000044408920985006, \
0.400000000000000022204460492503, 0.500000000000000000000000000000, \
0.599999999999999977795539507497, 0.700000000000000066613381477509}
easiest way is to make the iteration step width into a rational number
In[41]:= Table[x, {x, 0.1, 0.7, Rationalize[0.1]}]
Out[41]= {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7}
In[42]:= FullForm[%]
Out[42]//FullForm= List[0.1`, 0.2`, 0.30000000000000004`, 0.4`, 0.5`, 0.6`, 0.7000000000000001`}]