MathGroup Archive 2000

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

Search the Archive

RE: Annoying Little Problem

Mathematica can either use your machine numerical function OR if more
precision is required, its own.
N is a numerical evaluation function.

Then if you evaluate
v={4, 0, -6}
N[Sqrt[v.v}] will compute a numerical evaluation of Sqrt[v.v]
See : N[Sqrt[v.v}]//FullForm to view the internals.

If you evaluate N[Sqrt[v.v},3], Mathematica will keep using the standard
numerical function. See N[Sqrt[v.v},3]//FullForm to view the internals.
N[Sqrt[v.v],64] will increase the precision.

If you need a formatting function, use NumberForm :
NumberForm[N at Sqrt[v.v], {3, 2}]

> -----Message d'origine-----
> De : Nalanji Dreaming [mailto:ayrton at]
> Envoyé : vendredi 4 août 2000 07:19
> À : mathgroup at
> Objet : [mg24701] Annoying Little Problem
> I'm having an annoying little problem with version 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: A Functional Programming Question
  • Next by Date: RE: Annoying Little Problem
  • Previous by thread: Re: Annoying Little Problem
  • Next by thread: RE: Annoying Little Problem