Re: Accuracy question
- To: mathgroup at smc.vnet.net
- Subject: [mg14105] Re: Accuracy question
- From: Robert Knapp <rknapp>
- Date: Fri, 25 Sep 1998 03:15:29 -0400
- Organization: Wolfram Research, Inc.
- References: <6tp1ij$2tk@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Ersek, Ted R wrote: > > In the lines below SetPrecision[Round,False] makes it so Precision and > accuracy return the actual floating point numbers that are used > internally. $NumberMarks=True, makes it so (among other things) > InputForm[num] returns all digits used internally, and the precision > marks at the end of inexact numbers. > > In[1]:= > SetPrecision[Round,False]; > $NumberMarks=True; > x=12345.67; > > Out[2] shows exactly how Precision[x] is represented internally. Out[3] > shows that Precision[x] is the number closest to Log[10, 2^53]. > > In[2]:= > Precision[x]//InputForm > > Out[2]= > 15.9545897701910028` > > > In[3]:= > N[N[Log[10,2^53],17]]//InputForm > > Out[3]= > 15.9545897701910028` > > The next line shows exactly how Accuracy[x] is represented internally. > Where does this number come from? > Since accuracy is the number of digits to the right of the decimal I > expect to get roughly 11.9. But why > ( 11.8630751061039617` )? > > In[4]:= > Accuracy[x]//InputForm > > Out[4]= > 11.8630751061039617` > The prinicpal you are looking for is In[1]:= SetPrecision[Round,False]; $NumberMarks=True; x=12345.67; In[2]:= Precision[x] - Accuracy[x] Out[2]= 4.09151 In[3]:= Log[10.,x] Out[3]= 4.09151 i.e. the difference between precision and accuracy is the scale (log base 10 of the absolute value of the number)