Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

RE: Get rounds values in alist

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43997] RE: [mg43946] Get rounds values in alist
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
  • Date: Fri, 17 Oct 2003 05:14:22 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

>-----Original Message-----
>From: Oliver Friedrich [mailto:oliver.friedrich at tzm.de]
To: mathgroup at smc.vnet.net
>Sent: Wednesday, October 15, 2003 10:59 AM
>To: mathgroup at smc.vnet.net
>Subject: [mg43997] [mg43946] Get rounds values in alist
>
>
>Hallo,
>
>I have written a file "values.txt" with the text editor.
>The file content is
>
>{
>{{11735.72,11759.37,11711.12},{11556.84,11581.84,11620.91},
>{11131.76,11156.36,11196.09},{11475.20,11499.64,11448.35}},
>...
>many lines...
>...
>{12058.76,12087.74,12120.00},{11973.05,12000.74,11945.40}},
>{{11891.12,11916.49,11867.50},{11781.42,11808.29,11850.32},
>{11835.51,11863.17,11904.79},{11668.03,11694.20,11636.97}}
>}
>
>Reading this file into Mathematica usin Get[] returns a list
>{{{11735.7, 11759.4, 11711.1}, {11556.8, 11581.8, 11620.9}, {11131.8, 
>11156.4,
>       11196.1}, {11475.2, 11499.6, 11448.4}}, {{11680.8, 11704.8, 
>      11654.8}, {11444.6, 11470., 11508.3}, {11205.4, 11231., 
>      11268.9}, {11512.6, 11536.6, 11485.5}}, {{11983.9, 12010.3, 
>      11961.4}, {11768.8, 11796.2, 11832.9}, {11883.9, 11911.2, 
>      11946.9}, {12110.1, 12137.4, 12081.8}}, {{11613.6, 11638.3, 
>      11589.}, {11464.9, 11491.6, 11527.8}, {11199.8, 11225.4, 
>      11262.9}, {11404.4, 11429., 11377.4}}, {{11898.9, 11924.1, 
>      11874.5}, {11713.3, 11740.2, 11777.6}, {11682.7, 11709.3, 
>      11744.}, {11808.5, 11833.7, 11783.2}}, {{11542.5, 11567.5, 
>      11520.}, {11484., 11510.7, 11546.2}, {11059.3, 11085.2, 
>      11118.3}, {11278.3, 11303.2, 11252.9}}, {{12333., 12358.3, 
>      12308.2}, {11723.2, 11749.9, 11787.6}, {11956.1, 11982.2, 
>      12023.8}, {11884.4, 11908.7, 11855.6}}, {{11524.3, 11549.4, 
>      11497.4}, {11359.1, 11385.8, 11431.5}, {11089.2, 11115.6, 
>      11153.2}, {11411.3, 11436.3, 11381.5}}, {{12011.1, 12038., 
>      11986.9}, {11819.3, 11847.8, 11885.7}, {12058.8, 12087.7, 
>      12120.}, {11973.1, 12000.7, 11945.4}}, {{11891.1, 11916.5, 
>      11867.5}, {11781.4, 11808.3, 11850.3}, {11835.5, 11863.2, 
>      11904.8}, {11668., 11694.2, 11637.}}}
>So Get rounds the value 11735.72 from the original text file 
>to 11735.7 in 
>the list and so on. How can I avoid this and get in the full precision?
>
>Thank you
>
>Oliver Friedrich
>

Nothing is lost, the machine numbers are just not displayed fully.

In[68]:=
!! "e:\\www\\Mathematica\\User Groups\\MathGroup\\2003\\values.txt"
>From In[68]:=
{{{11735.72,11759.37,11711.12},{11556.84,11581.84,11620.91},
{11131.76,11156.36,11196.09},{11475.20,11499.64,11448.35}}}

In[69]:=
data = Get["e:\\www\\Mathematica\\User Groups\\MathGroup\\2003\\values.txt"]
Out[69]=
{{{11735.7, 11759.4, 11711.1}, {11556.8, 11581.8, 11620.9}, {11131.8,
11156.4,
       11196.1}, {11475.2, 11499.6, 11448.4}}}

In[70]:=
NumberForm[data, 8]
Out[70]//NumberForm=
{{{"11735.72", "11759.37", "11711.12"}, {"11556.84", "11581.84", 
      "11620.91"}, {"11131.76", "11156.36", "11196.09"}, {"11475.2", 
      "11499.64", "11448.35"}}}


--
Hartmut Wolf


  • Prev by Date: Re: Summation Problem w/ 5.0
  • Next by Date: Re: Linux & Mathematica 4.2:NotebookDirectory is not a known option
  • Previous by thread: Re: Get rounds values in alist
  • Next by thread: Concentric contours about the centroid, having the same length, and interior to an initial contour.