C++ class cBigNumber implements integers of unlimited range.
The class provides for all regular operations of language C++,
including arithmetic, logic and bitwise operations, operations of comparison,
shift operations, and also stream input-output with all of integer modifiers.
Extra functions - power, power by module, square root and Miller strong
probable primality test.
The class uses fast algorithms, such as the binary exponentiation,
optimized for numbers containing up to 100,000 and more bits.
More large numbers can also be used; the exponentiation tests were carried
out for numbers containing up to 12,000,000 bits.
The class has reenterable code to support development of multithreaded applications.
Microsoft Visual C++ 6.0, 2002-2017,
Borland C++ 3.1 (16 bit), 4.5, Builder 1.0,
GNU g++ 2.9.6, 3.3.3 (ARM), 4.1.2, 4.2.3.
Performance of the class
The programmer's manual and change list
Version 2.1c beta public of Nov 17, 2017, documentation updated Nov 30, 2017 (support for 128/64 bit hardware division)
Version 2.1b beta public of Sep 10, 2017, documentation updated Nov 10, 2017 (optimized division by 64/128 bit divider)
Version 2.1a beta public of Jun 27, 2017 (optimized division by 32/64 bit divider)
Version 2.1 beta public of Dec 28, 2016 (fast intrinsic-based multiplication and operations with 64 bit divider/module)
Version 2.0a public of Jul 29, 2016 (asm code with MULX instruction)
The preceding version:
2.0 public of Nov 20, 2010, documentation updated Jan 16, 2015 (64 bit C/asm code for Visual C++/g++)
The preceding 32-bit versions:
1.2c public of Mar 30, 2011 (reenterable)
1.2b public of Nov 19, 2009, updated Nov 20, 2010 (g++)
The preceding beta versions:
1.2a beta public of Sep 22, 2007
1.2 beta public of Jun 15, 2007
1.1a beta public of Nov 26, 2005
Assembler add-on for Visual/Borland C++ and g++ with faster multiplication and division is available by request.
You must not pay for class cBigNumber. If you have decided to support
its development - just transfer funds to one of the following
R717244026810, Z995907015597, E482829916444,
Amount is for choice of your own. Please, show purpose of transfer as
"cBigNumber". The transfer is accepted as voluntary donation, funds of
which are directed to development and testing of the class. Donation may be
conditioned by implementation of additional functions by agreement.
|To subscribe to the mailing list ||
and send message.|
|To cancel mailing subscription ||
and send message.|
|To write a letter to the author ||
|Though it is not required, you are strongly encouraged
to subscribe to the mailing list. The mailing list is intended for delivering
of announcements concerning new versions of this software and bug warnings.
The author confirms that your email address will never be used for any
other purposes and will not be delivered to third persons.
C++ template of dynamic arrays with automatic check of an index
Big Natural Numbers (rus)
The Prime Page
Miller strong probable prime test