MathGroup Archive 2002

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

Search the Archive

RE: Problem with Precision?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34456] RE: [mg34447] Problem with Precision?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Wed, 22 May 2002 02:46:24 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Mike,

This is a common question and source of confusion.

Basically, the purpose of N is NOT to set display precision. It's purpose is
to convert EXACT numbers (such as Pi, Sqrt[2] etc.) into APPROXIMATE
numbers. It will do nothing for the expression you give since the first
argument is not an exact number. It only affects the display precision if
you specify more than machine precision as the second argument, and if you
start with an exact expression.

The default display precision for machine numbers is 6 places. There are two
methods you can use to change this. You can go to the Option Inspector
(Shift-Ctrl-O), show options for notebook, then go to
FormattingOptions\Expression Formatting\Display Options\Print Precision
and change it from 6 to a higher value.

If you don't want all your numbers changed, but just certain outputs, then
use NumberForm.

NumberForm[1.602176462, 10]
1.602176462

Internally, Mathematica calculates with machine precision, even though it
normally displays only 6 places.

For more information on controlling precision in Mathematica calculations
check Sections 3.1.3 to 3.1.6 in The Mathematica Book.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

> From: Mike [mailto:M.P.Croucher at sheffield.ac.uk]
To: mathgroup at smc.vnet.net
>
> Can anyone shed any light on why
>
> N[1.602176462,10]
>
> gives
>
> 1.60218
>
> I need it to be as accurate as I can get it and 5 dp doesn't cut
> it.  Any ideas?
>
> Thanks
>
> Mike
>
>



  • Prev by Date: Plotting mulitple lists on one log plot
  • Next by Date: MathML Conference: Registration Deadline Extension
  • Previous by thread: RE: Problem with Precision?
  • Next by thread: Re: Problem with Precision?