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>: arithmetic ( ab- )
<lang Retro>:arithmetic (ab-)
over "\na = %d" puts
over '\na_______=_%n s:put
dup "\nb = %d" puts
dup '\nb_______=_%n s:put
2over + "\na + b = %d" puts
dup-pair + '\na_+_b___=_%n s:put
2over - "\na - b = %d" puts
dup-pair - '\na_-_b___=_%n s:put
2over * "\na * b = %d" puts
dup-pair * '\na_*_b___=_%n s:put
/mod "\na / b = %d" puts
/mod '\na_/_b___=_%n s:put
"\na mod b = %d\n" puts ;</lang>
'\na_mod_b_=_%n\n" s:put ;</lang>


=={{header|REXX}}==
=={{header|REXX}}==