You can fix this problem by using ReadList
instead of Import
. I have added some demo steps below to explore displayed rounding and equality. Note the final test d == e
? is False
in Mathematica 7 but True
in Mathematica 9, (with all the expected digits). So it looks like some precision has been added to Import
by version 9. The demo uses a demo file.
Contents of demo.dat:
0.22381193949113697971853298440692014992237091064453125
"0.22381193949113697971853298440692014992237091064453125"
Exploring:-
a = Import["demo.dat"]
b = ReadList["demo.dat"]
a[[1, 1]] == a[[2, 1]]
b[[1]] == b[[2]]
a[[1, 1]] == b[[1]]
a[[1, 1]] == ToExpression@b[[2]]
b[[1]] // FullForm
c = First@StringSplit[ToString@FullForm@b[[1]], "`"]
b[[2]]
ToExpression /@ {c, b[[2]]}
d = N[FromDigits[RealDigits[a[[1, 1]]]], 100]
e = N[FromDigits[RealDigits[b[[1]]]], 100]
d == e