2VARIABLE AMOUNT
1234567. AMOUNT 2!
AMOUNT 2@ D. (displays 1234567)
The above example declares a double-precision variable called AMOUNT. The value 1,234,567 is then stored in the variable with 2! . Finally, the value is retrieved from the variable using 2@ and displayed with D. .
As can be seen (and as indicated by the stack signature) AMOUNT returns its address (see 2VARIABLE ) which is used by 2@ to return the actual double value stored at that address.
|