Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problem with TableForm

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124942] Problem with TableForm
  • From: zosi <zosi at to.infn.it>
  • Date: Mon, 13 Feb 2012 03:41:14 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

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


  • Prev by Date: surprising timings for multiplication of diagonalmatrix and full matrix
  • Next by Date: Re: Some assistance from seasoned users.
  • Previous by thread: Re: surprising timings for multiplication of diagonalmatrix and full matrix
  • Next by thread: simple question on DSolve