Suppose we have run a calculation and get a number like
2.758952615889003`
If we then copy-paste this number and do a calculation like
2.758952615889003`-1
Mathematica will give a red 0. and an error about no significant digits. Why does this happen (note:putting a "`" on the 1 fixes the problem, so perhaps I am mixing different types of numbers?)
Even more worrisome to me, is that perhaps my calculations in some long program will be messed up from such an issue.
Is there a global setting that I can change (for example, at the top of a document or something), so that mathematica can properly do such calculations (with some "acceptable" amount of error?
I realize that if I instead do
N[2.758952615889003]`-1
Mathematica will do the calculation. I also realize that this is an issue with precision.
However, I have tried reading the documentation and some questions on this site, and I don't understand either 1) What the issue is, 2) Whether I can globally set precision so that such calculations work out with some acceptable amount of error.
For example, I believe using N
as above, means mathematica uses machine precision. Is this machine precision good though? Or bad? I tried reading through the documentation and I can't figure it out.
I realize that there are questions about this on the site, and that mathematica has documentation on this, but honestly I cannot understand it well. So here I am specifically looking for if someone can explain how I can deal with this, in a more simple manner
Edit: One more thing. The help documentation here makes me think arbitrary precision numbers are better (since it talks about arbitrary precision numbers maintaining a pertaining number of correct digits, and machine precision numbers needed to be checked for correctness). If that is the case though, how come arbitrary precision numbers don't work in the simple example, but using N
for machine precision does?
. Then you can operate on x without worry. Alterantively, you can put a space between the number and the minus sign. 2.758952615889003
-1 works fine while 2.758952615889003`-1 (without the space) does not. $\endgroup$-1
digits of precision. This results in a red zero with a tooltip stating that "No significant digits are available to display." Similarly,Precision[2.758952615889003`-1]
evaluates to0
digits of precision with a warning ofPrecision::precsm: Requested precision -1. is smaller than $MinPrecision. Using $MinPrecision instead.
$\endgroup$2.758952615889003`
is not an arbitrary-precision number. EvaluatingPrecision[2.758952615889003`]
will show that it is a machine precision number. Either2.758952615889003`15
orSetPrecision[2.758952615889003`, 15]
are arbitrary-precision numbers with 15 digits of precision. $\endgroup$