Chapter 2 C Language Reference
© National Instruments Corporation 2-43 AutoCode Reference
the maximum possible value representable in 32 bits—is returned. This
multiplication process can be expensive because it involves several
multiplication and addition operations to produce an intermediate result.
This procedure strives for accuracy, but a user can speed up the process by
giving up some of the accuracy.
32-Bit DivisionAs with 32-bit multiplication, operands are split into higher and lower
words. This method is based on Euclidean division or repeated division.
The higher and lower words of the numerator are divided by the higher and
lower words of the denominator. The remainder obtained from this step is
repeatedly divided to get components of the quotient. These components
are added up to get the final quotient. As with 32-bit multiplication, this can
be costly because of several addition, division, and multiplication
operations needed to calculate the intermediate results. Again, you can
speed up the routine at the cost of accuracy.
16-Bit by 8-Bit DivisionDepending on the radix value of the operands and the result, this operation
might result in either an iterative division or a fast-shift-based division.
For example, let n1 be the dividend with radix value r1, n2 be the divisor
with radix value n2, and n3 be the result with radix value r3. If the term:
r1 – (r2) – (r3) ≤ BYTE_SIZE
where BYTE_SIZE is 8, it will result in a call to an iterative division.
Otherwise, it will be a fast-shift-based division. The iterative division
method is costly in terms of speed, but is needed to compute an accurate
result. By changing this behavior, you can speed up the operation if you are
willing to give up some accuracy.
32-Bit by 16-Bit DivisionDepending on the radix value of the operands and the result, this operation
might result in either an iterative division or a fast-shift-based division.
For example, let n1 be the dividend with radix value r1, n2 be the divisor
with radix value n2, and n3 be the result with radix value r3. The following
term:
r1 – (r2) – (r3) ≤ WORD_SIZE
where WORD_SIZE is 16, results in a call to an iterative division. Otherwise,
it will be a fast-shift-based division. The iterative division method is costly