42

If I compute, say, 1/3//N, Mathematica displays

0.333333

as the result. When I copy that output to use elsewhere, the paste produces

0.3333333333333333`

What is the meaning and function of the backtick ?

I realize this must be quite elementary. I stand ready to be educated. :-)

Artes
  • 57,212
  • 12
  • 157
  • 245
Joseph O'Rourke
  • 4,731
  • 25
  • 42

2 Answers2

35

The backtick is a short-hand to mark the precision of your output. If it is not followed by any number, it denotes machine precision. You can denote arbitrary precision by including a number, as for example, 0.3`20.

By default, these are not displayed in StandardForm, which is why you see them only when copying, at which point it gets converted to InputForm. You can show them with NumberMarks -> True. For example:

Sqrt[2] // N
(* 1.4142135623730951 *)

InputForm[Sqrt[2] // N, NumberMarks -> True]
(* 1.4142135623730951` *)
rm -rf
  • 88,781
  • 21
  • 293
  • 472
31

The default value of

$NumberMarks
Automatic  

means that ` should by default be used in arbitrary-precision but not machine-precision numbers. Arbitrary-precision numbers can contain an arbitrary number of digits e.g. :

Sqrt[3`21] == 1.73205080756887729353

Machine numbers contain the same number of digits and maintain no information on their precision, e.g. :

{Sqrt[3`10] == Sqrt[3] // N, Sqrt[3`10]}
{True, 1.7320508076}

One can force machine numbers to be shown with number marks by :

Block[{$NumberMarks = True}, ToString[N[1/3], InputForm]]
0.3333333333333333`      

Precision[x] yields the effective number of digits of precision in the number x.

Precision /@ {1/3, 1/3 // N}

enter image description here

Precision[1/3 // N] // N
15.9546
Round[MachinePrecision]
16

You can count the number of digits before the backtick, namely 16.
The MachinePrecission is a real number because on the hardware level it is represented in the binary form. This needs 53 bits to represent almost 16 digits :

N@{MachinePrecision*Log[2, 10], MachinePrecision}
{53., 15.9546}  
Artes
  • 57,212
  • 12
  • 157
  • 245
  • Thank you! Strange that one needs to round MachinePrecision to see its value. – Joseph O'Rourke Mar 14 '12 at 01:10
  • 1
    @Joseph MachinePrecision is a symbolic constant like Pi and E. You can see its value using N[MachinePresicion] as well. This is what Artes did with Precision[1/3 // N] // N. Rounding gives the approximate (integer) number of digits of precision it corresponds to. – Szabolcs Mar 14 '12 at 05:55
  • @Szaboics: Thanks, that makes sense! – Joseph O'Rourke Mar 15 '12 at 00:42
  • 1
    This is indeed a very educational answer, Artes---Thanks! – Joseph O'Rourke Mar 15 '12 at 00:45
  • You are welcome, I'm glad I could help. – Artes Mar 15 '12 at 00:46
  • No need to numerically evaluate MachinePrecision. $MachinePrecision serves that purpose. `In[14]:= $MachinePrecision === N[MachinePrecision]

    Out[14]= True`

    – Daniel Lichtblau Mar 18 '12 at 03:09
  • @DanielLichtblau I have rather different observation : MachinePrecision === N[MachinePrecision] yields False while MachinePrecision == N[MachinePrecision] yields True. The same with E and Pi. – Artes Mar 18 '12 at 08:45
  • 1
    @Artes Oops. I had typed $MachinePrecision. That dollar signs, apparently get munged. I might have caught it in a response. But not a comment, as they don't show what the result will look like. – Daniel Lichtblau Mar 19 '12 at 01:21
  • Very helpful. A related question. Suppose I copy output and want to paste it somewhere WITHOUT the backticks. What is the best way? – PaulCommentary Nov 09 '23 at 17:53
  • @PaulCommentary Programatically one can find many ways and I'm not going to list them all, I recommend doing it manually: press ctrl+f write the bactick in the window find and in the window replace don't write anything then continue pressing replace and find next until you complete your task. – Artes Nov 09 '23 at 23:27