MathGroup Archive 2000

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

Search the Archive

Re: Re: Annoying Little Problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg24881] Re: [mg24865] Re: Annoying Little Problem
  • From: "Tomas Garza" <tgarza at mail.internet.com.mx>
  • Date: Sat, 19 Aug 2000 04:45:54 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

I think perhaps it is not a matter of precision, but rather of what
Mathematica prints as an answer. E.g.:

In[1]:=
Print[NumberForm[N[Sqrt[v2.v2]], 1]]
"7."
In[2]:=
Print[NumberForm[N[Sqrt[v2.v2]], 2]]
"7.2"
In[3]:=
Print[NumberForm[N[Sqrt[v2.v2]], 3]]
"7.21"
In[4]:=
Print[NumberForm[N[Sqrt[v2.v2]], 20]]
"7.211102550927978"

Mathematica keeps enough precision inside, but will print only what you ask
(and the default is 5).

Tomas Garza
Mexico City

 Alan [mailto:kd7cyb at mac.com] wrote:

> Mathematica thinks that Sqrt[v2.v2] is sufficiently accurate enough that
> the parameter specified to reduce it down to 3 digit precision is
> not used;
> thus, it reverts to the default 6 display digits. This is normal. Use
> SetPrecision of 3 instead. N[Sqrt[v2.v2], 3] should be:
>
> SetPrecision[Sqrt[v2.v2],3]
>
> Alan
>
> Nalanji Dreaming wrote:
>
> > I'm having an annoying little problem with version 4.0.1.0. I wrote the
> > following info in a notebook and ran it:
> >
> > Clear[v2]
> > v2 = {4, 0, -6}
> > N[Sqrt[v2.v2]]
> > N[Sqrt[v2.v2], 3]
> >
> > Now the third line gives me 7.2111 but the fourth line gives me the
> > same instead of 7.21. Does anyone have any idea what may be the problem?
> > Am I doing something wrong?
> >
> > thanks,
> > Nalanji Dreaming



  • Prev by Date: Re: REQUEST: Are there any notebooks or packages about Bayesian data analysis?
  • Next by Date: Re: Annoying Little Problem
  • Previous by thread: Re: Annoying Little Problem
  • Next by thread: Re: Annoying Little Problem