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

9 lines
178 B
Text
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
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
}