RosettaCodeData/Task/Even-or-odd/OCaml/even-or-odd-3.ocaml
2023-07-01 13:44:08 -04:00

8 lines
211 B
Text

(* hmm, only valid for N >= 0 *)
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