RosettaCodeData/Task/Arithmetic-Integer/Bc/arithmetic-integer.bc

9 lines
178 B
Plaintext

define f(a, b) {
"add: "; a + b
"sub: "; a - b
"mul: "; a * b
"div: "; a / b /* truncates toward zero */
"mod: "; a % b /* same sign as first operand */
"pow: "; a ^ b
}