next up previous contents
Next: Algorithms Up: Dyadic Digit Operations Previous: Shift operators

Relational Tests

Equality of dyadic digits is simply the equality of its elements.

(a,b) = (c,d) \Rightarrow (a=c) \ \textrm{and }(b=d)\end{displaymath}

In order to test other relationships, we first express the numerator terms of the dyadic fraction in terms of the same denominator, and then test the numerators. For example, to test whether $(a,b) \geq (c,d)$, let

(a',c') = \left\{\begin{array}
(a,c) & \textrm{if } b =...
 ...a\!\cdot\!2^{d-b},c) & \textrm{if } b < d \ \end{array}\right.\end{displaymath}

Now return the result $(a' \geq c')$. Other relational operators may be substituted for the greater than or equal ($\geq$) to perform other tests.

Martin Escardo