Import numerical data without truncation

Hi,
I have a data file consisting of 4 columns with floating numbers generated by a C program, with each number given to 16 significant digits. I’ve used the Import command and also ReadList to import this data to a Mathematica notebook: data=Import[“file.dat”] or ReadList[“file.dat”,{Number,Number,Number,Number}].
Either way, Mathematica is only importing the first 6 significant digits of each number. Is there a way around this so that all the significant digits are read?
Thanks.

David Halpern

From what I read I think you are actually do import all significant bits, but Mathematica only shows the first 6 by default. You can check by:

Pi // N
FullForm[%]

Thanks for the response but I still don’t quite understand what is happening.

Here is what I do.
(1) I import a matrix A using A=Import[“data.dat”]
(2) If I type A[[1,2]] I get 0.992745.
(3) If Itype N[A[[1,2]],16]] I get exactly the same answer as in (2), which in my opinion is strange since the result should be given to 16 digit precision. However, if I use the FullForm command, I get all the digits 0.99274468827 that were stored in the file data.dat.

Hi David,

Take a look at this post on MSE for an explanation.

Again, it is just SHOWING 6 digits for a machine number. Under the Preferences => Appearance => Formatting => Numbers you can set the number of digits, displayed by default.