Arithmetic/Integer: Difference between revisions

m
→‎{{header|dc}}: 'p' does not pop the stack; use 'sz' to pop and discard the top value.
m (→‎{{header|dc}}: 'p' does not pop the stack; use 'sz' to pop and discard the top value.)
Line 416:
=={{header|dc}}==
<lang dc>[Enter 2 integers on 1 line.
Use whitespace to separate. Example: 2 3
Use underscore for negative numbersintegers. Example: _10 is negative 10.]p ? sb sa
[add: ]P la lb + p
[sub: ]P la lb? -sb psa
[muladd: ]P la lb *+ p sz
[divsub: ]P la lb /- p [truncates toward zero]sz
[modmul: ]P la lb %* p [sign matches first operand]sz
[powdiv: ]P la lb ^/ p</lang> sz [truncates toward zero]sz
[mod: ]P la lb % p sz [sign matches first operand]sz
[addpow: ]P la lb +^ p sz</lang>
 
=={{header|E}}==
Anonymous user