Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modular Inverse Built-In, C++

There is a very nice way to find a modular inverse (that is, such b that ab ≡ 1 (mod m) for given a and m) in python-3.8:

b = pow(a, -1, m)

pow is built-in in python-3.8. Is there something like this in c++?

like image 970
Zhiltsoff Igor Avatar asked Nov 20 '25 04:11

Zhiltsoff Igor


1 Answers

No there is no built-in function in C++ (to answer your question :) ).

like image 120
Coder Avatar answered Nov 21 '25 18:11

Coder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!