On 6/6/12 at 4:53 AM,
fca...@gmail.com (fcaleyo) wrote:
>Hi guys, I've got a problem with ToExpression[]. It seems to round
>large real numbers off, e.g. ToExpression["109266.75"] returns
>109267., still a real, yet not exactly what the original string
>meant. Any idea to solve this? Many thanks fcaleyo
This isn't as you describe. By default Mathematica *displays*
real numbers rounded to six significant digits. But the value
used by Mathematica is not rounded in that manner. This can be
seen by the following:
In[3]:= a = ToExpression["109266.75"]
Out[3]= 109267.
In[4]:= RealDigits[a]
Out[4]= {{1,0,9,2,6,6,7,5,0,0,0,0,0,0,0,0},6}
You can set your preferences so that Mathematica displays either
more or less significant digits f you are so inclined.