       Re: N

• To: mathgroup at yoda.ncsa.uiuc.edu
• Subject: Re: N
• From: uunet!cello.hpl.hp.com!jacobson
• Date: Thu, 22 Mar 90 13:37:12 PST

```The real situation is even worse than Fateman claims.  On input
Mathematica uses trailing decimals to determine accuracy and
precision, but only if the resulting precision is higher than machine
precision.  Furthermore, one can't use N to reliably force the precision
down: N[...,3] seems to act as though it were N[...,Max[3,<<machine
precision>>]].

In:= 1.

Out= 1.

In:= Precision[%]

Out= 16

In:= N[%39,3]

Out= 1.

In:= Precision[%]

Out= 16

At the Mathematica conference, one of the WRI folks, (Jerry Keiper or
Igor Rivin, I believe) claimed than N[] only lowers precision, never
raises it.  However, here is a counter example.

In:= 1.000000000000000000000000001 -
1.0000000000000000000000000001

-28
Out= 9. 10

In:= Precision[%]

Out= 1

In:= N[%43]

-28
Out= 8.99999 10

In:= Precision[%]

Out= 16

and its not just that I used N with no second argument

In:= N[%43,16]

-28
Out= 8.99999388963799 10

In:= Precision[%]

Out= 16

Finally, numbers seem to carry their precision around with them, but I
can't seem to access it.  I'd like to be able to do this in cases
where I want to do my own error analysis.

In:= p3 = N[Pi,3]

Out= 3.14

In:= p5=N[Pi,5]

Out= 3.1416

In:= Precision[p3]

Out= 16

In:= Precision[p5]

Out= 16

In:= Accuracy[p3]

Out= 15

In:= Accuracy[p5]

Out= 15

In:= p3===p5

Out= True

Somehow p3 will print to 3 places and p5 will print to 5 places, but I
don't know how the formatter knows that information.

-- David Jacobson

```

• Prev by Date: Re: N
• Next by Date: Mathematica speedup technique
• Previous by thread: Re: N