|
|
|
參閱(See):
A.8 選用的雙數值詞集(The optional Double-Number word set)
Sixteen-bit Forth systems often use double-length numbers. However, many Forths on small embedded systems do not, and many users of Forth on systems with a cell size of 32 bits or more find that the use of double-length numbers is much diminished. Therefore, the words that manipulate double-length entities have been placed in this optional word set.
Append table 8.1 to table 3.5.
參閱(See):
3.2.6 環境的詢問(Environmental queries)
表格 8.1 - 環境詢問字串
字串 值 資料型別 常數? 意義 ------ --------------- --------- ------- DOUBLE flag no 雙數值詞集存在 DOUBLE-EXT flag no 雙數值延伸詞集存在
Table 8.1 - Environmental Query Strings
String Value data type Constant? Meaning ------ --------------- --------- ------- DOUBLE flag no double-number word set present DOUBLE-EXT flag no double-number extensions word set present
When the text interpreter processes a number that is immediately followed by a decimal point and is not found as a definition name, the text interpreter shall convert it to a double-cell number.
例如, 輸入 DECIMAL 1234 會留下單一單元數字 1234 在堆疊上, 而輸入 DECIMAL 1234. 會留下雙單元數字 1234 0 在堆疊上.
For example, entering DECIMAL 1234 leaves the single-cell number 1234 on the stack, and entering DECIMAL 1234. leaves the double-cell number 1234 0 on the stack.
參閱(See):
3.4.1.3 文字解譯器數字轉換(Text interpreter input number
conversion),
RFI 0004 數字轉換(Number Conversion).
The phrase Providing the Double-Number word set shall be appended to the label of any Standard System that provides all of the Double-Number word set.
措辭 從雙數值延伸詞集提供 name(s) 必須被加到任何提供部分雙數值延伸詞集的標準系統的描述之中.
The phrase Providing name(s) from the Double-Number Extensions word set shall be appended to the label of any Standard System that provides portions of the Double-Number Extensions word set.
措辭 提供雙數值延伸詞集 必須被加到任何提供所有雙數值詞集和雙數值延伸詞集的標準系統的描述之中.
The phrase Providing the Double-Number Extensions word set shall be appended to the label of any Standard System that provides all of the Double-Number and Double-Number Extensions word sets.
The phrase Requiring the Double-Number word set shall be appended to the label of Standard Programs that require the system to provide the Double-Number word set.
措辭 需要雙數值延伸詞集中的 name(s) 必須被加到任何需要系統提供部分雙數值延伸詞集的標準程式的描述之中.
The phrase Requiring name(s) from the Double-Number Extensions word set shall be appended to the label of Standard Programs that require the system to provide portions of the Double-Number Extensions word set.
措辭 需要雙數值延伸詞集 必須被加到任何需要系統提供所有雙數值和雙數值延伸詞集的標準程式的描述之中.
The phrase Requiring the Double-Number Extensions word set shall be appended to the label of Standard Programs that require the system to provide all of the Double-Number and Double-Number Extensions word sets.
8.6.1.0360 2CONSTANT
( x1 x2 "<spaces>name" -- )
跳過開頭的空白分界符號. 分析出由一個空白分界的 name. 為 name 創造一個有以下執行語義的定義.
name 將會被參考為 雙-常數 .
name 執行: ( -- x1 x2 )
將單元對 x1 x2 放置於堆疊.
參閱:
3.4.1 分析,
A.8.6.1.0360 2CONSTANT
8.6.1.0360 2CONSTANT
( x1 x2 "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below.
name is referred to as a two-constant.
name Execution: ( -- x1 x2 )
Place cell pair x1 x2 on the stack.
See:
3.4.1 Parsing,
A.8.6.1.0360 2CONSTANT
8.6.1.0390 2LITERAL
解譯: 這個詞的解譯語義是未定義的.
編譯: ( x1 x2 -- )
將下列的執行語義加進目前的定義.
執行時期: ( -- x1 x2 )
將單元對 x1 x2 放置於堆疊上.
8.6.1.0390 2LITERAL
Interpretation: Interpretation semantics for this word are undefined.
Compilation: ( x1 x2 -- )
Append the run-time semantics below to the current definition.
Run-time: ( -- x1 x2 )
Place cell pair x1 x2 on the stack.
8.6.1.0440 2VARIABLE
( "<spaces>name" -- )
跳過開頭的空白分界符號. 分析出由一個空白分界的 name. 為 name 創造一個有以下執行語義的定義. 保留兩個連續的資料空間單元.
name 將會被參考為一個 雙-常數.
name 執行: ( -- a-addr )
a-addr 是當 2VARIABLE 定義 name 時, 在資料空間保留的兩個連續單元的第一個單元(最低位址)的位址. 一個程式需負責初始化它的內容.
參閱:
3.4.1 分析,
6.1.2410 VARIABLE ,
A.8.6.1.0440 2VARIABLE
8.6.1.0440 2VARIABLE
( "<spaces>name" -- )
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below. Reserve two consecutive cells of data space.
name is referred to as a two-variable.
name Execution: ( -- a-addr )
a-addr is the address of the first (lowest address) cell of two consecutive cells in data space reserved by 2VARIABLE when it defined name. A program is responsible for initializing the contents.
See:
3.4.1 Parsing,
6.1.2410 VARIABLE ,
A.8.6.1.0440 2VARIABLE
8.6.1.1040 D+
( d1|ud1 d2|ud2 -- d3|ud3 )
將 d2|ud2 加進 d1|ud1 得到結果 d3|ud3.
8.6.1.1040 D+
( d1|ud1 d2|ud2 -- d3|ud3 )
Add d2|ud2 to d1|ud1, giving the sum d3|ud3.
8.6.1.1050 D-
( d1|ud1 d2|ud2 -- d3|ud3 )
從 d1|ud1 減去 d2|ud2, 得到差值 d3|ud3.
8.6.1.1050 D-
( d1|ud1 d2|ud2 -- d3|ud3 )
Subtract d2|ud2 from d1|ud1, giving the difference d3|ud3.
8.6.1.1060 D.
( d -- )
以自由欄位格式顯示 d.
8.6.1.1060 D.
( d -- )
Display d in free field format.
8.6.1.1070 D.R
( d n -- )
以欄位為 n 個字元寬的方式顯示右對齊的 d. 如果需要用來顯示 d 的字元數目大於 n, 所有的數字會以必要的寬度來顯示出來, 而沒有開頭的空白.
參閱:
A.8.6.1.1070 D.R
8.6.1.1070 D.R
( d n -- )
Display d right aligned in a field n characters wide. If the number of characters required to display d is greater than n, all digits are displayed with no leading spaces in a field as wide as necessary.
See:
A.8.6.1.1070 D.R
8.6.1.1075 D0<
( d -- flag )
在 d 小於零時 flag 為真.
8.6.1.1075 D0<
( d -- flag )
flag is true if and only if d is less than zero.
8.6.1.1080 D0=
( xd -- flag )
如果 xd 等於零時, flag 為真.
8.6.1.1080 D0=
( xd -- flag )
flag is true if and only if xd is equal to zero.
8.6.1.1090 D2*
( xd1 -- xd2 )
xd2 是將 xd1 向最大有效位元位移一個位元的結果, 將空出的最小有效位元填入零.
參閱:
A.8.6.1.1090 D2*
8.6.1.1090 D2*
( xd1 -- xd2 )
xd2 is the result of shifting xd1 one bit toward the most-significant bit, filling the vacated least-significant bit with zero.
See:
A.8.6.1.1090 D2*
8.6.1.1100 D2/
( xd1 -- xd2 )
xd2 是將 xd1 向最小有效位元位移一個位元的結果, 保持最大有效位元不變.
參閱:
A.8.6.1.1100 D2/
8.6.1.1100 D2/
( xd1 -- xd2 )
xd2 is the result of shifting xd1 one bit toward the least-significant bit, leaving the most-significant bit unchanged.
See:
A.8.6.1.1100 D2/
8.6.1.1110 D<
( d1 d2 -- flag )
如果 d1 小於 d2, 則 flag 為真.
8.6.1.1110 D<
( d1 d2 -- flag )
flag is true if and only if d1 is less than d2.
8.6.1.1120 D=
( xd1 xd2 -- flag )
如果 xd1 每一個位元跟 xd2 相同, flag 為真.
8.6.1.1120 D=
( xd1 xd2 -- flag )
flag is true if and only if xd1 is bit-for-bit the same as xd2.
8.6.1.1140 D>S
( d -- n )
n 是 d 的相等值. 如果 d 在 s 的一個有號單一單元數值的範圍之外時, 將會發生模稜兩可的情況.
參閱:
A.8.6.1.1140 D>S
8.6.1.1140 D>S
( d -- n )
n is the equivalent of d. An ambiguous condition exists if d lies outside the range of a signed single-cell number.
See:
A.8.6.1.1140 D>S
8.6.1.1160 DABS
( d -- ud )
ud 是 d 的絕對值.
8.6.1.1160 DABS
( d -- ud )
ud is the absolute value of d.
8.6.1.1210 DMAX
( d1 d2 -- d3 )
d3 是 d1 和 d2 之間的較大者.
8.6.1.1210 DMAX
( d1 d2 -- d3 )
d3 is the greater of d1 and d2.
8.6.1.1220 DMIN
( d1 d2 -- d3 )
d3 是 d1 和 d2 之間的較小者.
8.6.1.1220 DMIN
( d1 d2 -- d3 )
d3 is the lesser of d1 and d2.
8.6.1.1230 DNEGATE
( d1 -- d2 )
d2 是 d1 的負值.
8.6.1.1230 DNEGATE
( d1 -- d2 )
d2 is the negation of d1.
8.6.1.1820 M*/
( d1 n1 +n2 -- d2 )
將 d1 乘以 n1, 產生中介的三單元結果 t. 將 t 除以 +n2, 得到雙單元商數 d2. 當 +n2 為 0 或負數, 或是商位於超過一個有號雙精確整數的範圍時, 將會出現模稜兩可的情況.
參閱:
A.8.6.1.1820 M*/
8.6.1.1820 M*/
( d1 n1 +n2 -- d2 )
Multiply d1 by n1 producing the triple-cell intermediate result t. Divide t by +n2 giving the double-cell quotient d2. An ambiguous condition exists if +n2 is zero or negative, or the quotient lies outside of the range of a double-precision signed integer.
See:
A.8.6.1.1820 M*/
8.6.1.1830 M+
( d1|ud1 n -- d2|ud2 )
將 n 加進 d1|ud1, 得到結果 d2|ud2.
參閱:
A.8.6.1.1830 M+
8.6.1.1830 M+
( d1|ud1 n -- d2|ud2 )
Add n to d1|ud1, giving the sum d2|ud2.
See:
A.8.6.1.1830 M+
8.6.2.0420 2ROT
( x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2 )
旋轉堆疊上面的三個單元對, 將單元對 x1 x2 變成在堆疊的最上方.
8.6.2.0420 2ROT
( x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2 )
Rotate the top three cell pairs on the stack bringing cell pair x1 x2 to the top of the stack.
8.6.2.1270 DU<
( ud1 ud2 -- flag )
如果 ud1 小於 ud2 時, flag 為真.
8.6.2.1270 DU<
( ud1 ud2 -- flag )
flag is true if and only if ud1 is less than ud2.
內容列表(Table of Contents)
下一章(Next Section)