Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #8522

Problem with TableForm

From zosi <zosi@to.infn.it>
Newsgroups comp.soft-sys.math.mathematica
Subject Problem with TableForm
Date 2012-02-13 08:43 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jhaiet$54b$1@smc.vnet.net> (permalink)

Show all headers | View raw


Dear Mathgroup,
I have a list "data" with 15 couples of numbers.
data = {{11111.222223333344444, 0.0000000000000005},
                             {11111.2222233333, 0.00000000005},
                             {11111.22222, 0.000005},
                              {11.2233, 0.00005},
                             {11.223300000000, 0.0000000000005} ,
                             {11.2233000000000000000,  
0.00000000000000000005},
                             {1234000., 0.5},
                             {1.234, 0.0005},
                             {1234000.00005, 0.000005},
                             {1234000000.000054321, 0.0000000005},
                            {0.00001234, 0.000000005},
                             {0.00012340000000000,  0.00000000000000005},
                             { 1.0*1020, 0.5},
                             { 100000000000000000000., 0.5},
                              {1.0*103, 0.5}}

I need to prepare a Table like the following

TableForm[Table[{i, NumberForm[data[[i, 1]], 20],
                                       Precision[data[[i, 1]]],
                                      -Log[10, data[[i, 2]]/data[[i, 1]] ],
                                       Accuracy[data[[i, 1]]],
                                      -Log[10, data[[i, 2]]]
                                  }, {i, 1, Length[data]}],
  TableHeadings -> {{}, {"i", "x", "Precision[x]", "-Log[10,Abs[err/x]]",
                                        "Accuracy[x]", 
"-Log[10,Abs[x]]",}}]

You can observe that  the second column "x" shows the data[[i,1]].
Unfortunately, in some cases (i=5,7,9,10,12,13,14,15),
the printed value is not EXACTLY equal to the corresponding value in "data"
for example
data[[5,1]]= 11.223300000000 is printed as 11.2233
data[[7,1]]= 1234000.               is printed as 1.234*10^6

Can you teach me how to obtain in the Table the same format as in "data"?
I have tried without success various alternative options (ScientificForm,
AccountingForm, PaddedForm,...). Some of them work, but not in every case.

Many thanks for your help

Gianfranco Zosi
Dip Fisica Generale
Univ Torino- Italy

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Problem with TableForm zosi <zosi@to.infn.it> - 2012-02-13 08:43 +0000

csiph-web