Message Boards Message Boards

2
|
1789 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Calculations with significant figures

Dear all,

being a humble user of this amazing software, I cannot work out a matter that, surely, it is peanuts for you guys: calculations with significant figures.
Suppose I am performing a calculation where different values and magnitudes are plugged into a formula (with different sig. fig.). How can I instruct Mathematica to return the correct value of the calculation considering the correct number of sig. fig. ?

For example, 2 / 0.034 = 58.82352941176471.... but since one of the arguments has 1 sig. fig., the scientific result would be 60.

Mind: I do not talk about a simple calculation as the above. Consider a wider expression with many different quantities (all expressed in different sig. fig.).

How can I work this out?

Many thanks to you all. Mauro B.

2 Replies

You can also use newer objects explicitly designed to keep track of measurement uncertainty (Around) and interval extent (CenteredInterval). Depending on whether one interprets that 2 has uncertainty 1 or 0.5 we have:

In[1]:= Around[2, 1] / Around[0.034, 0.001]
Out[1]= Around[58.8235294117647, 29.462606169422838`]

In[2]:= Around[2, 0.5]/Around[0.034, 0.0005]
Out[2]= Around[58.8235294117647, 14.731303084711419`]

or with CenteredInterval (use Normal to convert to a number, or Interval to convert to an interval):

In[3]:= CenteredInterval[2, 1]/CenteredInterval[0.034, 0.001]
Out[3]= CenteredInterval[{{493874757, -23, 537451950, -24}, 30}]

In[4]:= CenteredInterval[2, 0.5]/CenteredInterval[0.034, 0.0005]
Out[4]= CenteredInterval[{{493554267, -23, 1059690066, -26}, 30}]

See how they typeset in notebooks:

enter image description here

Hi Mauro,

Unless explicitly specified, WL assumes MachinePrecision for non-exact numerical values.

Using specific precision

2`1 / 0.034`3
(* 6.*10^1 *)

Take a look at this and this.

POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract