This is documentation for Mathematica 5, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Documentation / Mathematica / The Mathematica Book / A Practical Introduction to Mathematica / Numerical Calculations /

1.1.1 Arithmetic

You can do arithmetic with Mathematica just as you would on an electronic calculator.

This is the sum of two numbers.

In[1]:= 2.3 + 5.63

Out[1]=

Here the / stands for division, and the ^ stands for power.

In[2]:= 2.4 / 8.9 ^ 2

Out[2]=

Spaces denote multiplication in Mathematica. You can use a * for multiplication if you want to.

In[3]:= 2 3 4

Out[3]=

You can type arithmetic expressions with parentheses.

In[4]:= (3 + 4) ^ 2 - 2 (3 + 1)

Out[4]=

Spaces are not needed, though they often make your input easier to read.

In[5]:= (3+4)^2-2(3+1)

Out[5]=

Arithmetic operations in Mathematica.

Arithmetic operations in Mathematica are grouped according to the standard mathematical conventions. As usual, 2 ^ 3 + 4, for example, means (2 ^ 3) + 4, and not 2 ^ (3 + 4). You can always control grouping by explicitly using parentheses.

This result is given in scientific notation.

In[6]:= 2.4 ^ 45

Out[6]=

You can enter numbers in scientific notation like this.

In[7]:= 2.3 10^70

Out[7]=

Or like this.

In[8]:= 2.3*^70

Out[8]=