Wolfram Language Fast Introduction for Math Students
Get Started »

Fractions & Decimals

In the Wolfram Language, exact input (like fractions) will provide exact output:

(Use CTRL+ / to enter fractions.)
In[1]:=
Click for copyable input
1/4 + 1/3
Out[1]=

Put fractions over their lowest common denominator with Together:

In[2]:=
Click for copyable input
Together[1/a + 1/b]
Out[2]=

Any input containing decimals gives approximate output:

In[1]:=
Click for copyable input
.25 + 1/3
Out[1]=

Use N to get a numerical approximation of a result:

In[2]:=
Click for copyable input
N[1/4 + 1/7]
Out[2]=

Specify the accuracy to which your answer is displayed:

In[3]:=
Click for copyable input
N[1/4 + 1/7, 10]
Out[3]=

Some numbers are better expressed in ScientificForm:

In[1]:=
Click for copyable input
ScientificForm[0.00123]
Out[1]=

ScientificForm is applied automatically when appropriate:

In[2]:=
Click for copyable input
N[100!]
Out[2]=

QUICK REFERENCE: Rational Functions »

QUICK REFERENCE: Numerical Evaluation & Precision »