← 都来码 / Dolaima← 例程索引dbase/school/arithmetic_integer.prg 原文

dbase/school/arithmetic_integer.prg · 317 字节 · 下载原文

procedure Test( a, b )
   ? "a+b", a + b
   ? "a-b", a - b
   ? "a*b", a * b
   // The quotient isn't integer, so we use the Int() function, which truncates it downward.
   ? "a/b", Int( a / b )
   // Remainder:
   ? "a%b", a % b
   // Exponentiation is also a base arithmetic operation
   ? "a**b", a ** b
   return