cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
modulo problem
modulo problem
Apr 23, 2014 at 2:02pm UTC
coder1
(85)
I have two numbers:
A= a1*a2*a3.....an
B= b1*b2*b3.....bm
I need to calculate (A/B) mod 10^9+7 because a and b may be very large numbers
How should I do that ( it is proved that B is a divisor of A).
Apr 23, 2014 at 2:14pm UTC
AbstractionAnon
(6954)
a and b may be very large numbers
Define very large. More than 18 decimal digits?
If 18 decimal digits or less you can use int64, otherwise you will have to use a bigint library. Here's one:
http://gmplib.org/
There are others.
Apr 23, 2014 at 2:21pm UTC
coder1
(85)
Actually I need the modulo, it is a problem on an online judge.
Topic archived. No new replies allowed.