=================================================================== RCS file: /home/cvs/OpenXM/doc/OpenXM-specs/cmo-basic1.tex,v retrieving revision 1.12 retrieving revision 1.14 diff -u -p -r1.12 -r1.14 --- OpenXM/doc/OpenXM-specs/cmo-basic1.tex 2002/01/20 09:26:21 1.12 +++ OpenXM/doc/OpenXM-specs/cmo-basic1.tex 2015/08/18 02:54:05 1.14 @@ -1,4 +1,4 @@ -%% $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 表現 } //&eg \section{ CMOexpressions for numbers and polynomials } \label{sec:basic1} @@ -14,6 +14,7 @@ #define CMO_RING_BY_NAME 26 #define CMO_DISTRIBUTED_POLYNOMIAL 31 #define CMO_RATIONAL 34 +#define CMO_COMPLEX 35 #define CMO_INDETERMINATE 60 @@ -72,6 +73,12 @@ ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/B & & \mbox{ --- 有理数 $a/b$ を表す. } \\ \mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm 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{ --- 変数名 $v$ . } \\ \end{eqnarray*} @@ -96,6 +103,12 @@ ZZ, QQ, Zero, Rational, Indeterminate $\in$ CMObject/B & & \mbox{ --- Rational number $a/b$. } \\ \mbox{Rational} &:& ({\tt CMO\_RATIONAL}, {\sl CMObject}\, {\rm a}, {\sl CMObject}\, {\rm 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{ --- Variable name $v$ . } \\ \end{eqnarray*} @@ -681,25 +694,25 @@ $\in$ CMObject/MachineDouble \\ & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\ & & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\ & & \mbox{ --- この表現はCPU依存である.}\\ -&& \mbox{\quad\quad mathcap に CPU 情報を付加しておく.} \\ +&& \mbox{\quad\quad byte order negotiation を用いる.} \\ \mbox{Array of 64bit machine double} &:& \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])\\ & & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の double (64bit) である. } \\ & & \mbox{ --- この表現はCPU依存である.}\\ -& & \mbox{ \quad\quad mathcap に CPU 情報を付加しておく.} \\ +& & \mbox{ \quad\quad byte order negotiation を用いる.} \\ \mbox{128bit machine double} &:& \mbox{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\ & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\ & & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\ & & \mbox{ --- この表現はCPU依存である.}\\ -&& \mbox{\quad\quad mathcap に CPU 情報を付加しておく.} \\ +&& \mbox{\quad\quad byte order negotiation を用いる.} \\ \mbox{Array of 128bit machine double} &:& \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]})\\ & & \mbox{ --- s*[1], $\ldots$ s*[m] は m 個の long double (128bit) である. } \\ & & \mbox{ --- この表現はCPU依存である.}\\ -& & \mbox{ \quad\quad mathcap に CPU 情報を付加しておく.} +& & \mbox{ \quad\quad byte order negotiation を用いる.} \end{eqnarray*} */ /*&eg @@ -709,25 +722,25 @@ $\in$ CMObject/MachineDouble \\ & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s8})\\ & & \mbox{ --- s1, $\ldots$, s8 は {\tt double} (64bit). } \\ & & \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{({\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])\\ & & \mbox{ --- s*[1], $\ldots$ s*[m] are 64bit double's. } \\ & & \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{({\tt CMO\_128BIT\_MACHINE\_DOUBLE}, } \\ & & \quad \mbox{ {\sl byte} s1 , \ldots , {\sl byte} s16})\\ & & \mbox{ --- s1, $\ldots$, s16 は {\tt long double} (128bit). } \\ & & \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{({\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]})\\ & & \mbox{ --- s*[1], $\ldots$ s*[m] are 128bit long double's. } \\ & & \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*} */ @@ -741,10 +754,29 @@ $\in$ CMObject/MachineDouble \\ /*&jp IEEE 準拠の float については, IEEE 754 double precision floating-point 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 See IEEE 754 double precision floating-point (64 bit) for the details of 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