next up previous
Next: Distributed polynomial Dpolynomial Up: CMOexpressions for numbers and Previous: Zero

Integer ZZ

#define     CMO_ZZ          20

We describe the bignum (multi-precision integer) representation in OpenXM. In OpenXM CMO_ZZ is used to represent bignum. Its design is similar to that in GNU MP. (cf. plugin/cmo-gmp.c in the kan/sm1 distribution). CMO_ZZ is defined as follows.

int32 CMO_ZZ int32 f int32 b0 $\cdots$ int32 bn

f is a 32bit integer. $b_0, \ldots, b_n$ are unsigned 32bit integers. |f| is equal to n+1. The sign of f represents that of the above CMO. As stated in Section 2, a negative 32bit integer is represented by two's complement.

In OpenXM the above CMO represents the following integer. ( R = 232.)


\begin{displaymath}\mbox{sgn}(f)\times (b_0 R^{0}+ b_1 R^{1} + \cdots + b_{n-1}R^{n-1} + b_n R^n).
\end{displaymath}

If we express int32 by the network byte order, a CMO_ZZ 14 is expressed by


\begin{displaymath}\mbox{(CMO\_ZZ, 1, 0, 0, 0, e)},
\end{displaymath}

The corresponding byte sequence is

\begin{displaymath}\mbox{\tt00 00 00 14 00 00 00 01 00 00 00 0e}
\end{displaymath}

Note that CMO_ZZ 0 is expressed by (CMO_ZZ, 00,00,00,00).


next up previous
Next: Distributed polynomial Dpolynomial Up: CMOexpressions for numbers and Previous: Zero
Nobuki Takayama 平成12年1月25日