Re: Scientifc notation
- To: mathgroup at smc.vnet.net
- Subject: [mg41331] Re: [mg41312] Scientifc notation
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 15 May 2003 03:57:07 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
The problem is that in Mathematica your two expressions do not mean at all the same thing!. For example, in Mathematica 3000 is an exact integer while 3.00 10^3 is a floating point real--a very different thing. So you can't really "convert" between them. Having said that, you can almost achieve what you want as follows: data = {1., 30.43, 10^-3, 3000}; ScientificForm/@SetPrecision[data,3] 1 -3 3 {1.00, 3.04 × 10 , 1.00 × 10 , 3.00 × 10 } Note that in this way you get 3.04 10^1 and not 3.043 10^1 as you wanted. To get that you need: ScientificForm /@ SetPrecision[data, 4] but then you will get three digits after the decimal everywhere. Another possible approach is to enter your data specifying the precision as follows: data = {1`3, 30.43`4, 10^-3`3, 3000`3}; ScientificForm/@data 1 -3 3 {1.00, 3.043 × 10 , 1.00 × 10 , 3.00 × 10 } This now looks right, but I strongly recommend that try to understand the meaning of all this. "data" defined in this way consists of "arbitrary precision reals" (non-floating point) with low precision. They are again quite different entities form the ones you had originally. If you are only concerned with the way things look, this may be all you need, but if you are going to use these numbers for some further computations you had better consider carefully if they make sense in your situation. You may very well end up with quite different answers than you would have done with your original data. Andrzej Kozlowski Yokohama, Japan http://www.mimuw.edu.pl/~akoz/ http://platon.c.u-tokyo.ac.jp/andrzej/ On Wednesday, May 14, 2003, at 09:13 pm, J. Guillermo Sanchez wrote: > > Dear friend, > I would like obtein the output in scientific notation with a two > decimals. Here is an example: > > > data = {1.0, 30.43 10^-3, 3000} > > How convert to scientific notation > > {1.00 10^0, 3.043 10^1, 1.00 10^-3, 3.00 10^3} > > > > >