0

Why does

N[Log[10, 6613], 20] give the requested 20 digits of precision

(* $3.8203985227039816648$ *)

but

N[Log[10, 6613.3], 20] does not?

(* $3.82042$ *)

The documentation for Log states:

"The precision of the output tracks the precision of the input" so one might expect more digits in the output for the latter case.

David G. Stork
  • 41,180
  • 3
  • 34
  • 96
  • 1
    In addition to what sacratus said: Log[10, 6613.3] immediately evaluates to 3.82042, then N[..., 20] is applied only afterwards. N won't influence the calculation of the logarithm. Try Log[10, 6613.3`20]. This also evaluates immediately, but since it starts with an arbitrary precision (not machine precision) number, precision tracking kicks in. Thus the result will not have a precision of exactly 20, but it will be close. – Szabolcs Apr 08 '15 at 00:14

1 Answers1

2

Observe

In:

Precision[6613]

Out:

Infinity

In:

Precision[6613.3]

Out:

MachinePrecision

The first number is an integer and has infinite precision the second number is a numerical value that is represented with a finite precision.

sacratus
  • 1,556
  • 10
  • 18