Re: problems with N[]
- To: mathgroup at smc.vnet.net
- Subject: [mg38700] Re: [mg38687] problems with N[]
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Mon, 6 Jan 2003 03:42:31 -0500 (EST)
- References: <200301051133.GAA29061@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
It looks as if you're missing an explicit decimal point in order to prevent the otherwise unavoidable rational result. For example, In[1]:= result = N[Pi, 18] Out[1]= 3.14159265358979324 In[2]:= Round[result*10^4]/10.^4 Out[2]= 3.1416 Notice the decimal point after the 10 in 10.^4 Tomas Garza Mexico City ----- Original Message ----- From: "1.156" <rob at piovere.com> To: mathgroup at smc.vnet.net Subject: [mg38700] [mg38687] problems with N[] > I'm getting a numerical output which has about 12 significant digits. I wanted to give a printout to someone and I need only 4 significant digits (otherwise it represents a result to precise). > > I thought that was what N[] was for so I put out N[result,4]. > > For some reason I still get 12 digits displayed. I looked through he help material and it says > "n must lie between $MinPrecision and $MaxPrecision. $MaxPrecision can be set to Infinity. " > I checked and these numbers are 0 and 10^6, respectively. > > So, I gave up on N[] and tried Ceiling[10000*result]/10000 and damn if I didn't get "6/625" > for an answer. > > I want to display a decimal result with 4 significant digits, can anyone tell me how to do it? > > Thanks. > >
- References:
- problems with N[]
- From: "1.156" <rob@piovere.com>
- problems with N[]