Exact and Approximate Results

A standard electronic calculator does all your calculations to a particular accuracy, say ten decimal digits. With the Wolfram Language, however, you can often get exact results.

The Wolfram Language gives an exact result for (2^100), even though it has 31 decimal digits:

2^100

You can tell the Wolfram Language to give you an approximate numerical result, just as a calculator would, by ending your input with //(RefLink[N, paclet:ref/N]). The (RefLink[N, paclet:ref/N]) stands for "numerical". It must be a capital letter. "Special Ways to Input Expressions" will explain what the // means.

This gives an approximate numerical result:

2^100//N

The Wolfram Language can give results in terms of rational numbers:

1/3+2/7

//(RefLink[N, paclet:ref/N]) always gives the approximate numerical result:

1/3+2/7//N

Getting numerical approximations.

When you type in an integer like 7, the Wolfram Language assumes that it is exact. If you type in a number like 4.5, with an explicit decimal point, the Wolfram Language assumes that it is accurate only to a fixed number of decimal places.

This is taken to be an exact rational number, and reduced to its lowest terms:

452/62

Whenever you give a number with an explicit decimal point, the Wolfram Language produces an approximate numerical result:

452.3/62

Here again, the presence of the decimal point makes the Wolfram Language give you an approximate numerical result:

452./62

When any number in an arithmetic expression is given with an explicit decimal point, you get an approximate numerical result for the whole expression:

1.+452/62