# Floating Point/Epsilon

## Granularity

editFloating point numbers, because they are comprised of only a certain number of bits, have a granularity. They therefore cannot express an infinite amount of fractional values. This means that there is a "Largest Possible Value", ε, that satisfies the following equation:

This value is called the *machine epsilon* of the floating point system.

## Epsilon (ε)

editWhen a real number is rounded to the nearest floating point number, the machine epsilon forms an upper bound on the relative error. This fact makes the machine epsilon extremely useful in determining the convergence tolerances of many iterative numerical algorithms.

## Determining Epsilon

editThe machine epsilon^{[1]} can be computed according to the formula:

So, for IEEE 754 single precision we have

and for IEEE 754 double precision we have

When is not known, but is known to be 2, the machine epsilon can be found by starting with a trial value of, say, 0.5 and successively dividing the value by 2 until is true.

## Granularity Effects

editAn effect of this granularity is that some basic algebraic properties don't strictly hold. For instance, if we have three floating-point values, *x*, *y*, and *z*, we can show that:

When the floating-point numbers are used in iterative calculations, round-off and granularity errors can result in large errors.