我需要找到两个数字的模乘逆,数据类型是Boost的Multiprecision库提供的任何数据类型(gmp_int,cpp_int等)。有内置的功能吗?如果没有,您能否解释如何进行?

最佳答案

几周前增加了模乘逆。它们尚未在任何Boost版本中发布(但应在1.70中可用)。要使用它们,您需要克隆

$ git clone https://github.com/boostorg/integer

进入Boost树,或克隆所有boost并指向它的包含路径:
$ git clone --recursive https://github.com/boostorg/boost
$ cd boost/libs/integer
$ git checkout develop

源代码为here,文档为here

09-10 04:47
查看更多