RosettaCodeData/Task/Even-or-odd/OCaml/even-or-odd-3.ocaml
2015-11-18 06:14:39 +00:00

8 lines
207 B
Text

(* hmm, only valid for N0 *)
let rec myeven = function
| 0 -> true
| 1 -> false
| n -> myeven (n - 2)
(* and here we have the not function in if form *)
let myodd n = if myeven n then false else true