How to | Do Basic Calculations
The Wolfram Language serves as a convenient and extensible environment for doing basic math. In addition to performing advanced calculations, the Wolfram Language can also be used as a powerful calculator with arbitrary precision.
3 + 4Subtract a number from another number:
13 - 8Multiply two numbers by using * or a space:
2 * 5Spaces between numbers, variables, or function values are interpreted as multiplication. The Wolfram System automatically shows a space between numbers with a multiplication symbol:
2 5a Sin[2Pi t](1 + I) (1 - 3I)6 / 2The Wolfram Language follows the ordinary order of operations in algebraic calculations:
10 - 2(1 + 9 / 3)3 ^ 5Compute the square root of 25:
Sqrt[25]The Wolfram Language displays the results of calculations using integers, rational numbers, or variables in exact form:
10 - (5/7)Use N to get numerical results:
N[10 - (5/7)]Adding a decimal to any number forces a numerical result:
10. - (5/7)This shows 40 significant digits:
N[10 - (5/7), 40]Approximate
using N:
N[Pi]N[Pi, 50]Calculate 50 significant digits of
:
N[E ^ 10, 50]A large collection of common and well-known functions is built into the Wolfram Language.
Evaluate trigonometric functions:
Sin[Pi]Cos[1.2 + Pi ^ 2]Evaluate the natural logarithm of numbers:
Log[2.9]Prime[125]Find the sum of the first billion positive integers:
Sum[i, {i, 1, 10 ^ 12}]