In Russian   IMach   Priest - portal of dialogue and creativity   Author  

   E-mail   Last modified - Aug 8, 2010

C++ class for integers of unlimited range

C++ class  cBigNumber  implements integers of unlimited range. Click to enlarge
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 from 500 to 20,000 bits. More large numbers can also be used; the exponentiation tests were carried out for numbers containing up to 12,000,000 bits.

Test environments: Microsoft Visual C++ 6.0, 2002-2010, Borland C++ 3.1 (16 bit), 4.5, Builder 1.0, GNU g++ 2.9.6, 3.3.3 (ARM), 4.1.2 (64 bit), 4.2.3
The programmer's manual and change list

Test:

Download:
Version 2.0 alpha preview of Aug 7, 2010new (64 bit code for Visual C++, TESTING)
Version 1.2c beta public of Jul 28, 2010new (reenterable code for multithreaded applications)
Version 1.2b public of Nov 19, 2009, updated Jan 10, 2010 (g++ 64-bit and ARM compatible)
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 C++ and Borland C++ Builder with 10 times faster hardware multiplication is available by request.
Programs Mobile Arifexp, Matrix and Miller for ARM Pocket PC are available from download.ru.
Donations: You must not pay for class cBigNumber. If you have decided to support its development - just transfer funds to one of the following WebMoney purses: R717244026810, Z995907015597, E482829916444, U253542011720, B148113950490. 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.
Forum: Consultations (rus)
Contacts:
  • To subscribe to the mailing list 
  • click here and send message.
  • To cancel mailing subscription 
  • click here and send message.
  • To write a letter to the author 
  • click here.
    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.

    Publications:
    Paper for Programming and Computer Software 1/2010 (rus) new  English translation on ShpringerLink new 
    Paper for Program Products and Systems 1/2009 (rus) new  DOC file  
    Paper for SIBERCRYPT'05 (rus)   DOC file   Abstract (eng)   DOC file (eng)  

    Links:  C++ template of dynamic arrays with automatic check of an index
    Big Natural Numbers (rus)   The Prime Page   Miller strong probable prime test