MATHEMATICA FEATURED EXAMPLE

Do Calculations with Units

Units are automatically converted during arithmetic operations.

    
Use Quantity to represent units:
In[6]:=
Click for copyable input
Out[6]=
In[7]:=
Click for copyable input
Out[7]=
Arithmetic operations also handle unit cancellation automatically:
In[8]:=
Click for copyable input
Out[8]=
Estimate the number of miles that can be traveled on a low tank of gas. IndependentUnit is used to represent an arbitrary unit with no relationship to other units within Quantity:
In[9]:=
Click for copyable input
Out[9]=
New to Mathematica? Find your learning path »
Have a question? Ask support »