Sha256: a17b6aeb878afee3ce31819cdfc9b8b55354cce84c1c559fbe99433aaee495ec

Contents?: true

Size: 321 Bytes

Versions: 10

Compression:

Stored size: 321 Bytes

Contents

let _ =
  let a = read_int ()
  and b = read_int () in

  Printf.printf "a + b = %d\n" (a + b);
  Printf.printf "a - b = %d\n" (a - b);
  Printf.printf "a * b = %d\n" (a * b);
  Printf.printf "a / b = %d\n" (a / b);    (* truncates towards 0 *)
  Printf.printf "a mod b = %d\n" (a mod b) (* same sign as first operand *)

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/ocaml.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/ocaml.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/ocaml.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/ocaml.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/ocaml.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/ocaml.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/ocaml.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/ocaml.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/ocaml.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/ocaml.txt