(* Baseline: exception declaration + raise + try-with *)
exception NegArg of int ;;
let safe_sqrt n =
  if n < 0 then raise (NegArg n)
  else
    begin
      let rec find_sqrt i =
        if i * i > n then i - 1
        else find_sqrt (i + 1)
      in find_sqrt 0
    end ;;
let result =
  try
    safe_sqrt 16
  with
  | NegArg _ -> 0 ;;
result
