Arithmetic/Integer: Difference between revisions

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


=={{header|E}}==
=={{header|E}}==