错误消息"未实现"

时间:2014-09-25 19:13:13

标签: ocaml

我创建了一个递归函数来查找m到n次方而不使用**

let rec power m n = 
    match n with
    | 0 -> 1
    | _ -> m * (power m (n - 1));;

let test1 () : bool = (power 2 3) = 8;;
let test2 () : bool = (power 2 0) = 1;;
Assert.run_test "power test1" test1;;
Assert.run_test "power test2" test2;;

当我运行测试时,我收到一条错误消息     跑步:力量测试1 ...     测试错误:power test1报告power: unimplemented

0 个答案:

没有答案