Resolve type errors in math/mod_inverse_by_fermat_theorem.cpp

This commit is contained in:
Mann Mehta
2020-05-09 00:21:24 +05:30
parent 808464c4f6
commit c17b6a9ee0

View File

@@ -23,16 +23,16 @@
*
*/
#include<iostream>
#include<vector>
#include<iostream>
#include<vector>
// m is large prime number.
const long long int m = 1000000007;
// m is large prime number.
const int64_t m = 1000000007;
// Recursive function to calculate exponent in O(log(n)) using binary exponent.
long long int binExpo(long long int a, long long int b) {
int64_t binExpo(int64_t a, int64_t b) {
a %= m;
long long int res = 1;
int64_t res = 1;
while (b > 0) {
if (b%2) {
res = res * a % m;
@@ -46,7 +46,7 @@ long long int binExpo(long long int a, long long int b) {
int main() {
// Take input of a. (A number for which we want to find modular inverse with m)
long long int a;
int64_t a;
std::cout << "Give input a for computing ((a^(-1))%(m)) : ";
std::cin >> a;