Hi!
One of the C++ programmers problems is to work with integers greater than 2^64-1
(we can save 0
to 2^64-1
in unsigned long long int
). So I want to share the best Bignum implementation I have ever seen (Link) with CodeForces Community.
Its specifications are as follows:
Supported operations:
+
,-
,/
,*
,%
,^
(pow) ,gcd
,lcm
,abs
.It is able to work with Standard Input/Output streams.
It can cast data to
long long
,string
.It uses fast multiplication.
source.(but I have edited that and added pow
and size()
.)
UPD1 (September 2016): bug in void operator=(long long v)
is now fixed. Thanks to amsen.