Re: How to increase Working Precision?
- From: "marks@xxxxxxxxxxx" <marks@xxxxxxxxxxx>
- Date: Thu, 6 Mar 2008 08:44:30 -0800 (PST)
On Mar 6, 7:57 am, rjf <fate...@xxxxxxxxx> wrote:
Again, I suggest you read the manual, and in particular note the
difference between the Mathematica notions of precision and accuracy.
A very precise value for pi is 3.15000000000000000000000000000000
which happens not to be very accurate.
x has a small relative error (high precision)
In[1]:= x = 3.15000000000000000000000000000000;
In[2]:= Precision[x]
Out[2]= 32.4983
But it is not a good approximation to Pi, as you can
see by subtraction:
In[3]:= d = x - Pi
Out[3]= 0.0084073464102067615373566167205
In[4]:= Precision[d]
Out[4]= 29.9247
The difference in Precision between x and d indicates that
only about 2 of the displayed digits are close to Pi.
Regarding the original question, I'm unable to reproduce the
behaviour.
Here is the result from all versions back as far as Version 4.2
on a 32 bit Linux machine.
In[1]:= Pi + 2.0
Out[1]= 5.14159
In[2]:= MachineNumberQ[%]
Out[2]= True
If you instead meant that you want all results to a fixed Precision
of 25 digits then this can be accomplished as follows:
In[1]:= Block[{$MinPrecision = 25, $MaxPrecision = 25},
x = 2.`25;
Pi + x
]
Out[1]= 5.141592653589793238462643
Note in particular that x must be defined as a software float:
x = SetPrecision[2, 25];
x = 2.`25;
etc
and not:
x = 2.
which is a machine precision number.
Mark Sofroniou
Wolfram Research
.
- Follow-Ups:
- Re: How to increase Working Precision?
- From: Christopher Creutzig
- Re: How to increase Working Precision?
- References:
- How to increase Working Precision?
- From: Paul J Salmon
- Re: How to increase Working Precision?
- From: Nasser Abbasi
- Re: How to increase Working Precision?
- From: rjf
- Re: How to increase Working Precision?
- From: Nasser Abbasi
- Re: How to increase Working Precision?
- From: sashap
- Re: How to increase Working Precision?
- From: rjf
- How to increase Working Precision?
- Prev by Date: Re: How to increase Working Precision?
- Next by Date: Re: How to increase Working Precision?
- Previous by thread: Re: How to increase Working Precision?
- Next by thread: Re: How to increase Working Precision?
- Index(es):
Relevant Pages
|
Loading