我正在尝试编写Ocaml幂函数,但出现错误。这是下面的代码。
let rec power x n =
if n = 0 then 1
else x * power (x n-1)
Error: This expression has type int
This is not a function; it cannot be applied.
我正在尝试编写Ocaml幂函数,但出现错误。这是下面的代码。
let rec power x n =
if n = 0 then 1
else x * power (x n-1)
Error: This expression has type int
This is not a function; it cannot be applied.