next up previous contents
Next: Modification of mantissas Up: (Mantissa, Exponent) Operations Previous: Dyadic (mantissa, exponent) `normalisation'

Division

  We have already described an algorithm for division of a signed binary stream by an integer in section 4.3.3. Here we give an algorithm for division of two arbitrary reals. This algorithm is entirely my own work.

Suppose we wish to compute (a/b), where a and b are reals represented in signed binary (mantissa, exponent) representation by the numerals (x, ex) and (y', ey') respectively. The approach is as follows. First we modify the mantissa y' of the numeral b to find a new numeral (y, ey) which also represents b. We can perform division by this modified mantissa to obtain a new mantissa which represents 4x/y using the dyadic stream representation. Finally we convert this mantissa back into the signed binary representation, and use it and the exponents ex and ey to construct a numeral which represents a/b.

Note that division is undefined when the denominator is zero. It is impossible to test for equality using these representations (see section 2.2.2). Attempts to divide by zero will cause the algorithm to loop forever without returning digits.



 

Martin Escardo
5/11/2000