Commit 01680d11 authored by Taddeus Kroes's avatar Taddeus Kroes

funclang series2: Fixed typo.

parent 31f282d2
...@@ -57,7 +57,7 @@ let rec sum_digits n = ...@@ -57,7 +57,7 @@ let rec sum_digits n =
(* Get the digital root of a natural number n *) (* Get the digital root of a natural number n *)
let rec digitRoot n = let rec digitRoot n =
let sum = sum_digits n in let sum = sum_digits n in
if (String.length (string_of_int sum) == 1) then sum else (digitRoot sum) if (String.length (string_of_int sum) = 1) then sum else (digitRoot sum)
;; ;;
(* Test the digitRoot function for a few known solutions *) (* Test the digitRoot function for a few known solutions *)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment