MathGroup Archive 2002

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

Search the Archive

RE: The N function and precision


The behavior of N definitely changed between Version 3 and Version 4.

Basically, the purpose of N is to change exact expressions to approximate
number expressions. N has nothing directly to do with the display precision.
To directly control the display precision use NumberForm.

Machine precision approximate numbers, since Version 4, are displayed with 6
places. This can be changed through the Option Inspector. When you use N to
convert Pi, say, to an approximate number, it uses machine precision if k <=
16. Otherwise, it uses an extended precision number and those numbers are
displayed with the extended precision.

So basically
1) Use N to convert exact expressions to approximate number expressions.
2) Use NumberForm to specifically control the display of numbers.
3) Use the Option Inspector to change the default display precision of
machine precision numbers.

David Park
djmp at

From: Ray [mailto:rayfg at]
To: mathgroup at

In version 3.0 when I enter N[Pi,8], I get an output of 3.1415927 but
the same input in version 4.2 gives an output of 3.14159. In fact, in
version 4.2, N[Pi,k] for k between 0 and 16 gives an output of 3.14159
rather than a result with k digit precision. However, if k is 17 or
more, I do get k digit precision in version 4.2. What happened to the
"k" in N[expres,k] for k smaller than 17 in version 4.2. I have observed
this in all calculations in Mathematica as I switched my lessons from
3.0 to 4.2. My students have reported the same problem. How do we get k
digit precision for k smaller than 17  in version 4.2 Thanks.

  • Prev by Date: Mathematica on the web
  • Next by Date: Re: Vector field with ImplicitPlot ?
  • Previous by thread: Mathematica on the web
  • Next by thread: Direct tensor algebra