version 1.12, 2002/01/20 09:26:21 |
version 1.14, 2015/08/18 02:54:05 |
|
|
%% $OpenXM: OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v 1.11 2001/08/27 05:39:15 takayama Exp $ |
%% $OpenXM: OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v 1.13 2005/03/04 03:49:47 takayama Exp $ |
//&jp \section{ 数, 多項式 の CMO 表現 } |
//&jp \section{ 数, 多項式 の CMO 表現 } |
//&eg \section{ CMOexpressions for numbers and polynomials } |
//&eg \section{ CMOexpressions for numbers and polynomials } |
\label{sec:basic1} |
\label{sec:basic1} |
|
|
#define CMO_RING_BY_NAME 26 |
#define CMO_RING_BY_NAME 26 |
#define CMO_DISTRIBUTED_POLYNOMIAL 31 |
#define CMO_DISTRIBUTED_POLYNOMIAL 31 |
#define CMO_RATIONAL 34 |
#define CMO_RATIONAL 34 |
|
#define CMO_COMPLEX 35 |
|
|
|
|
#define CMO_INDETERMINATE 60 |
#define CMO_INDETERMINATE 60 |
Line 72 ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/B |
|
Line 73 ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/B |
|
& & \mbox{ --- 有理数 $a/b$ を表す. } \\ |
& & \mbox{ --- 有理数 $a/b$ を表す. } \\ |
\mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\ |
\mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\ |
& & \mbox{ --- $a/b$ を表す. } \\ |
& & \mbox{ --- $a/b$ を表す. } \\ |
|
\mbox{Bigfloat} &:& ({\tt CMO\_BIGFLOAT}, |
|
{\sl int32}\, {\rm sign}, {\sl int32}\, {\rm prec}, {\sl int64}\, {\rm exp}, |
|
{\sl int32}\, \mbox{a[1]}, \ldots , {\sl int32}\, \mbox{a[$\lfloor \frac{{\rm prec}+31}{32} \rfloor$]} ) \\ |
|
&:& \mbox{ --- bigfloat をあらわす. a[i] についてはあとで説明}\\ |
|
\mbox{Complex} &:& ({\tt CMO\_COMPLEX}, {\sl CMObject}\, {\rm re}, {\sl CMObject}\, {\rm im}) \\ |
|
& & \mbox{ --- $a+b\sqrt{-1}$ を表す. } \\ |
\mbox{Indeterminate} &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\ |
\mbox{Indeterminate} &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\ |
& & \mbox{ --- 変数名 $v$ . } \\ |
& & \mbox{ --- 変数名 $v$ . } \\ |
\end{eqnarray*} |
\end{eqnarray*} |
Line 96 ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/B |
|
Line 103 ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/B |
|
& & \mbox{ --- Rational number $a/b$. } \\ |
& & \mbox{ --- Rational number $a/b$. } \\ |
\mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\ |
\mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm b}) \\ |
& & \mbox{ --- Rational expression $a/b$. } \\ |
& & \mbox{ --- Rational expression $a/b$. } \\ |
|
\mbox{Bigfloat} &:& ({\tt CMO\_BIGFLOAT}, |
|
{\sl int32}\, {\rm sign}, {\sl int32}\, {\rm prec}, {\sl int64}\, {\rm exp}, |
|
{\sl int32}\, \mbox{a[1]}, \ldots , {\sl int32}\, \mbox{a[$\lfloor \frac{{\rm prec}+31}{32} \rfloor$]} ) \\ |
|
&:& \mbox{ --- bignfloat. The meaning of a[i] will be explained later.}\\ |
|
\mbox{Complex} &:& ({\tt CMO\_COMPLEX}, {\sl CMObject}\, {\rm re}, {\sl CMObject}\, {\rm im}) \\ |
|
& & \mbox{ --- Complex number $a+b\sqrt{-1}$. } \\ |
\mbox{Indeterminate} &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\ |
\mbox{Indeterminate} &:& ({\tt CMO\_INDETERMINATE}, {\sl Cstring}\, {\rm v}) \\ |
& & \mbox{ --- Variable name $v$ . } \\ |
& & \mbox{ --- Variable name $v$ . } \\ |
\end{eqnarray*} |
\end{eqnarray*} |
Line 681 $\in$ CMObject/MachineDouble \\ |
|
Line 694 $\in$ CMObject/MachineDouble \\ |
|
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\ |
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\ |
& & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\ |
& & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
&& \mbox{\quad\quad mathcap に CPU 情報を付加しておく.} \\ |
&& \mbox{\quad\quad byte order negotiation を用いる.} \\ |
\mbox{Array of 64bit machine double} &:& |
\mbox{Array of 64bit machine double} &:& |
\mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
\mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の double (64bit) である. } \\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の double (64bit) である. } \\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
& & \mbox{ \quad\quad mathcap に CPU 情報を付加しておく.} \\ |
& & \mbox{ \quad\quad byte order negotiation を用いる.} \\ |
\mbox{128bit machine double} &:& |
\mbox{128bit machine double} &:& |
\mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\ |
\mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\ |
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\ |
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\ |
& & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\ |
& & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
&& \mbox{\quad\quad mathcap に CPU 情報を付加しておく.} \\ |
&& \mbox{\quad\quad byte order negotiation を用いる.} \\ |
\mbox{Array of 128bit machine double} &:& |
\mbox{Array of 128bit machine double} &:& |
\mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
\mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte} s16[1], \ldots , {\sl byte} s16[m]})\\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte} s16[1], \ldots , {\sl byte} s16[m]})\\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の long double (128bit) である. } \\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の long double (128bit) である. } \\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
& & \mbox{ --- この表現はCPU依存である.}\\ |
& & \mbox{ \quad\quad mathcap に CPU 情報を付加しておく.} |
& & \mbox{ \quad\quad byte order negotiation を用いる.} |
\end{eqnarray*} |
\end{eqnarray*} |
*/ |
*/ |
/*&eg |
/*&eg |
Line 709 $\in$ CMObject/MachineDouble \\ |
|
Line 722 $\in$ CMObject/MachineDouble \\ |
|
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\ |
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\ |
& & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\ |
& & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
&& \mbox{\quad\quad Add informations on CPU to the mathcap.} \\ |
&& \mbox{\quad\quad Need the byte order negotiation.} \\ |
\mbox{Array of 64bit machine double} &:& |
\mbox{Array of 64bit machine double} &:& |
\mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
\mbox{({\tt CMO\_ARRAY\_OF\_64BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte}}\, s8[1], \ldots , {\sl byte}\, s8[m])\\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] are 64bit double's. } \\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] are 64bit double's. } \\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
& & \mbox{\quad\quad Add informations on CPU to the mathcap.} \\ |
& & \mbox{\quad\quad Need the byte order negotiation.} \\ |
\mbox{128bit machine double} &:& |
\mbox{128bit machine double} &:& |
\mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\ |
\mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\ |
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\ |
& & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\ |
& & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\ |
& & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
& & \mbox{\quad\quad Add informations on CPU to the mathcap.} \\ |
& & \mbox{\quad\quad Need the byte order negotiation.} \\ |
\mbox{Array of 128bit machine double} &:& |
\mbox{Array of 128bit machine double} &:& |
\mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
\mbox{({\tt CMO\_ARRAY\_OF\_128BIT\_MACHINE\_DOUBLE}, {\sl int32} m, } \\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte} s16[1], \ldots , {\sl byte} s16[m]})\\ |
& & \quad \mbox{ {\sl byte} s1[1] , \ldots , {\sl byte} s16[1], \ldots , {\sl byte} s16[m]})\\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] are 128bit long double's. } \\ |
& & \mbox{ --- s*[1], $\ldots$ s*[m] are 128bit long double's. } \\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
& & \mbox{ --- Encoding depends on CPU.}\\ |
& & \mbox{\quad\quad Add informations on CPU to the mathcap.} \\ |
& & \mbox{\quad\quad Need the byte order negotiation.} \\ |
\end{eqnarray*} |
\end{eqnarray*} |
*/ |
*/ |
|
|
Line 741 $\in$ CMObject/MachineDouble \\ |
|
Line 754 $\in$ CMObject/MachineDouble \\ |
|
/*&jp |
/*&jp |
IEEE 準拠の float については, IEEE 754 double precision floating-point |
IEEE 準拠の float については, IEEE 754 double precision floating-point |
format (64 bit) の定義を見よ. |
format (64 bit) の定義を見よ. |
|
|
|
256.100006 の Intel Pentium の double64 での内部表現は |
|
{\tt cd 0c 80 43 } \\ |
|
256.100006 の PowerPC (Mac) の double64 での内部表現は |
|
{\tt 43 80 0c cd }. |
|
この例でみるように byte の順序が逆である. |
|
エンジンスタートの時の byte order negotiation で byte の順序を指定する. |
|
|
|
|
*/ |
*/ |
/*&eg |
/*&eg |
See IEEE 754 double precision floating-point (64 bit) for the details of |
See IEEE 754 double precision floating-point (64 bit) for the details of |
float compliant to the IEEE standard. |
float compliant to the IEEE standard. |
|
|
|
The internal expression of 256.100006 in the Intel Pentium is |
|
{\tt cd 0c 80 43 } \\ |
|
The internal expression of 256.100006 in the PowerPC (Mac) is |
|
{\tt 43 80 0c cd }. |
|
As you have seen in this example, |
|
the orders of the bytes are opposite each other. |
|
The byte order is specified by the byte order negotiation protocol |
|
when the engine starts. |
|
|
*/ |
*/ |
|
|
\noindent |
\noindent |