First analyze the main arithmetic operations and generate the corresponding computation algorithms.

Given two positive floating-point numbers *s*_{1}.*B*^{e1} and *s*_{2}.*B*^{e2} their sum *s*.*B*^{e} is computed as follows.

Assume that *e*_{1} is greater than or equal to *e*_{2}; then (*alignment*) the sum of *s*_{1}.*B*^{e1} and *s*_{2}.*B*^{e2} can be expressed in the form *s*.*B*^{e}, where

The value of *s* belongs to the interval

so that *s* could be greater than or equal to *B*. If it is the case, that is, if

then (*normalization*) substitute *s* by *s*/*B*, and *e* by *e* + 1, so that the value of *s*.*B*^{e} is the same as before, and the new value of *s* satisfies

The significands *s*_{1} and *s*_{2} of the operands are multiples of *ulp*. If *e*_{1} is greater than *e*_{2}, the value of *s* could no longer be a multiple of *ulp* and some rounding function should be applied to *s*. Assume that

*s*′ and *s*″ being two successive multiples of *ulp*. Then the *rounding* function associates to *s* either *s*′ or *s*″, according to some rounding strategy. ...

Start Free Trial

No credit card required