# Precision[] and Accuracy[] give non-integer result

a = N[Pi, {20, 19}];
Precision[a] (*19.497149872694134*)
Accuracy[a](*19.*)

Accuracy[a]*Log2 (*63.116633802859894*)


### My question

The Precision[a] value is a non-integer, which I don't know what it means. And the Accuracy[a]*Log2 isn't an integer either. How in the essence the Precision and Accuracy value is measured if not in the number of bit?

The number precision recision is measured in number of bit rather than number of decimals which I deduce by Official Doc about Number Precision:

Note that to achieve full consistency in the treatment of numbers, precision and accuracy often have values that do not correspond to integer numbers of digits.

Therefore the following code runs like :

$MachinePrecision (*15.954589770191003*)$MachinePrecision == 53/Log2
(*True*)


# Updated 2020-05-11 00:38:50

In an arbitrary-precision number x with precision p, the definition of p is: $$p=-\log _{10}\left(\frac{\text{dx}}{x}\right)$$, in which dx is the amount of uncertainty. We are using x to approximate an unknown real number y lying in the open interval (x-dx x+dx).

For example:


Clear["*"]
prec = 300;
x = N[Pi, prec];
xAsPreciseValue =
SetPrecision[x,
prec + 1];(*Here has to be prec+1,to avoid the roundoff made by \
SetPrecision*)
dx = xAsPreciseValue*10^-prec;
N[-Log[10, dx/xAsPreciseValue]](*output 990 as expected*)
Block[
{Internal$EqualTolerance = 0}, TrueQ[ xAsPreciseValue - dx < Pi < xAsPreciseValue + dx ] ](*output all True as expected*)  About the necessity of Internal$EqualTolerance = 0 in the inequality, refer to this answer

• It's explained pretty clear in the documentation for those function, isn't it? (E.g., "With absolute uncertainty dx, Precision[x] is -Log[10,dx/x].") May 9 '20 at 23:20
• @MichaelE2 Oh please give me a link, I cannot find anything even with your keyword:"With absolute uncertainty " May 9 '20 at 23:59
• Maybe this will help: mathematica.stackexchange.com/a/156390/4999. Related: mathematica.stackexchange.com/a/124830/4999 -- HTH! :) May 10 '20 at 0:35
• Try Block[{Internal$EqualTolerance = 0}, xAsPreciseValue - dx < Pi < xAsPreciseValue + dx ] (ref. mathematica.stackexchange.com/a/86819/4999) May 10 '20 at 17:45 • I'm sorry I don't have time to write a complete response to your question. As you have noticed, the numeric environments in Mathematica are complicated. There is one exact one and two approximate ones, machine precision and arbitrary-precision (and arguably another when you set $MinPrecision and \$MaxPrecision). Further, in the approximate ones, comparisons <. ==, etc. are made "with tolerance," which can cause further confusion. E.g., the transitive properties of <, ==` do not always hold. The answer to your question would be long and repeat much of what has already been written. May 11 '20 at 1:38