How can i find a/b mod m in c++?
created
last reply
- 8
replies
- 692
views
- 2
users
- 1
link
How can i find a/b mod m in c++?
Type of a and b is double.
I have read what multiplicative inverse is from http://en.wikipedia.org/wiki/Modular_multiplicative_inverse6.
Due to double type, i cannot apply conventional gcd() approach. However, by computing the multiplicative inverse in decimal form, i can get results close but not accurate.