Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Re: How to display the desired numerical precision?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25256] Re: [mg25215] How to display the desired numerical precision?
  • From: Tomas Garza <tgarza01 at prodigy.net.mx>
  • Date: Sun, 17 Sep 2000 04:47:38 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

NumberForm[expr, n] prints with approximate real numbers in expr given 
to n digit precision. 

In[1]:=
Table[NumberForm[2.*Pi, j], {j, 1, 10}]
Out[1]=
{"6.", "6.3", "6.28", "6.283", "6.2832", "6.28319", "6.283185", 
"6.2831853", \
"6.28318531", "6.283185307"}

Tomas Garza
Mexico City

"Christopher R. Carlen" <crcarle at sandia.gov> wrote:

> In Mathematica 3, I could input
>
> N[ Pi, 12 ]
>
> and see 12 digits of result.  However in Mathematica 4 I see 6 digits, 
no matter
> what I put in for the number of digits, unless >16.  In other words,
>
> N[ Pi, 17 ]
>
> shows 17 digits.
>
> It seems that for less than or equal to machine precision, the result
> gets displayed using the setting of Formatting Options|Expression
> Formatting|Display OPtions|Print Precision.
>
> But for numbers greater than the maching precision, the result 
displays
> according the precision specified to the N function.
>
> Can someone tell me how to get the following behavior from Mathematica 
4:
>
> If I don't specify anything about precision, show 6 digits.
>
> Else if I specify any number of digits to N[] from 1 to n, then 
display
> n digits.



  • Prev by Date: Re: Testing the Head of List Elements
  • Next by Date: Re: List of Interpolated functions inside plot
  • Previous by thread: How to display the desired numerical precision?
  • Next by thread: RE: How to display the desired numerical precision?