Arithmetic/Integer: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: the two integers were "backwards".) |
|||
Line 4,012: | Line 4,012: | ||
Retro's arithmetic functions are based on those in [[Forth]]. The example is an adaption of the one from Forth. |
Retro's arithmetic functions are based on those in [[Forth]]. The example is an adaption of the one from Forth. |
||
<lang Retro>: |
<lang Retro>:arithmetic (ab-) |
||
over |
over '\na_______=_%n s:put |
||
dup |
dup '\nb_______=_%n s:put |
||
dup-pair + '\na_+_b___=_%n s:put |
|||
dup-pair - '\na_-_b___=_%n s:put |
|||
dup-pair * '\na_*_b___=_%n s:put |
|||
/mod |
/mod '\na_/_b___=_%n s:put |
||
'\na_mod_b_=_%n\n" s:put ;</lang> |
|||
=={{header|REXX}}== |
=={{header|REXX}}== |