next up previous contents
: Distributed polynomial Dpolynomial : CMOexpressions for numbers and : Zero   ܼ

Integer ZZ

#define     CMO_ZZ          20

We describe the bignum (multi-precision integer) representation CMO_ZZ in OpenXM. The format 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 $b_0$ $\cdots$ int32 $b_{n}$

$f$ is a 32bit integer. $b_0, \ldots, b_n$ are unsigned 32bit integers. $\vert f\vert$ is equal to $n+1$. The sign of $f$ represents that of the above integer to be expressed. 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 = 2^{32}$.)


\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}

Example: 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 contents
: Distributed polynomial Dpolynomial : CMOexpressions for numbers and : Zero   ܼ
Nobuki Takayama Heisei 28.8.27.