我需要使用 reticulate 调用将一个非常大的整数参数传递给 python,但我似乎找不到这样做的方法。关于如何做到这一点的任何建议?看到 python 对象在 int 类中,但是 R 数字作为预期的浮点数传递,但是我尝试在 R 中使用 gmp 和 bit64 包在 R 中使用这个大整数,但无论如何它没有作为类 int 在 python 中传递.
> library(reticulate)
> use_python("/usr/bin/python3")
> py_run_string("obj = 10**18;")
> py_eval('type(obj)')
<class 'int'>
> class(r_to_py(10^18))
[1] "python.builtin.float" "python.builtin.object"