0
$\begingroup$

This question already has an answer here:

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.

$\endgroup$

marked as duplicate by Michael E2, Mr.Wizard Apr 8 '15 at 0:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    $\begingroup$ 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. $\endgroup$ – Szabolcs Apr 8 '15 at 0:14
2
$\begingroup$

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.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.