使用 Printf.printf 和 Uint64.uint64 类型 OCAML

Using Printf.printf with Uint64.uint64 Type OCAML

我使用 OPAM 安装了 UInt64 包。我想知道如何将 UInt64 类型打印到屏幕上。我试过

let someVal = Uint64.of_string "0xcbf39ce214111325"
 Printf.printf "%u" someVal;

这是我得到的错误

This expression has type Uint64.uint64 ref
       but an expression was expected of type int

"%u" 指定了一个 int 参数。查看Uint64界面,你可能想通过转换为字符串来打印:printf "%s" (Uint64.to_string ...).