Re: Number of digits
- To: mathgroup at smc.vnet.net
- Subject: [mg73943] Re: Number of digits
- From: "Raj" <rajanikanth at gmail.com>
- Date: Sat, 3 Mar 2007 01:14:35 -0500 (EST)
- References: <es90d7$2f4$1@smc.vnet.net>
On Mar 2, 4:05 am, Robert Pigeon <robert.pig... at videotron.ca> wrote: > Good afternoon, > How can I force Mathematica to output an answer with a certain number of > significant digits ? What I mean is I want the answer of, let say, 1.0 / 3 > to be output in Mathematica as 0.33 for example. The reason I want to do > that is that I am making a table (using TableForm) of a list of answers to > use in a report. I do not want to see 0.33333 in the table just 0.33 ! > I could use SetPrecision[1./3, 2], but I do not want to do that for every > calculation. I have looked at $MachinePrecision and all other $.... , but I > cannot make sense out of it. > So what I am trying to do, in a nut shell, is do what can be done with a > pocket calculator, set my "visible" answer with a certain number of digits! > > Thanks, > > Robert > > Robert Pigeon > TZ = -5 Hey Robert, This doesn't answer ur question but u can try doing something like this SetPrecision[#,2]&/@{1/3,1/31,1/37} Substitute your own list for {1/3,1/31,1/37} Cheers, Raj