MathGroup Archive 2002

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

Search the Archive

RE: Question about precision.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38421] RE: [mg38405] Question about precision.
  • From: "David Park" <djmp at earthlink.net>
  • Date: Sat, 14 Dec 2002 03:20:15 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Web-Feng,

For machine precision numbers, the default, Mathematica normally only
displays 6 places of precision even though it calculates to full machine
precision - 16 places. To show more places use NumberForm.

Sqrt[1.3]
NumberForm[%, 16]

1.14018
1.140175425099138

You can use the Option Inspector to change the number of places normally
displayed. (Also N is only used to convert exact numbers to approximate
numbers and affects the display ONLY if you specify more than machine
precision. So NumberForm, and not N, is the correct function to control the
display.)

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


From: Wen-Feng Hsiao [mailto:wfhsiao at libra.seed.net.tw]
To: mathgroup at smc.vnet.net

Dear experts,

I try to find the square root of 1.3, but obtain an not so correct
answer. Could someone point me how to do? My trials are the
followings.

In[28]:=
Sqrt[1.3]

Out[28]=
1.14018

In[29]:=
Precision[Sqrt[1.3]]

Out[29]=
16

In[30]:=
N[Sqrt[1.3], 50]

Out[30]=
1.14018

In[31]:=
1.14018*1.14018

Out[31]=
1.30001

The more precise answer should be
In[32]:=
1.140175425*1.140175425

Out[32]=
1.3

Thanks for your help!

Wen-Feng Hsiao



  • Prev by Date: Re: SetComplexClass for J/Link
  • Next by Date: AW: too many {{}}'s for listplot
  • Previous by thread: RE: Question about precision.
  • Next by thread: Re: Question about precision.