此表达式的类型为int,但表达式的类型为[`Deprecated_use_float_module]

Chr*_*art 3 ocaml

我正在使用Jane Streets核心库,我正在尝试进行简单的float_of_int操作.我收到以下错误

This expression has type int but an expression was expected of type [ Deprecated_use_float_module ]

我怎么解决这个问题?例如,在utop解释器内部:

utop # open Core.Std;;
Run Code Online (Sandbox Code Playgroud)

utop # float_of_int 1;; Error: This expression has type int but an expression was expected of type [ Deprecated_use_float_module ]

谢谢!

编辑:我也在这里查看 Float模块里面似乎什么都没有.除非我不知道如何正确浏览文档,否则我不确定该怎么做.

ivg*_*ivg 8

他们试图告诉你,你应该使用Float.of_int功能.float_of_intJanestreet核心库不推荐使用该函数.