user657592
user657592

Reputation: 1061

How increase the range of long long in C++?

I am using dev C++ IDE to create a program to run the RSA algorithm. The algorithm, as is known, uses very large numbers. Numbers with 24-26 digits. The long long data types only supports upto 20 or so digits. How do I handle such huge numbers in C++? Is there a way I can change the limits/size/range of the long data type?

Upvotes: 0

Views: 272

Answers (2)

PlasmaHH
PlasmaHH

Reputation: 16046

Due to popular request:

There are a lot of bignumber libraries (all serving a different audience). Examples are:

  • gmp (or a better interface on top of it: mpfr)
  • mpir (gmp fork)

Also the wikipedia article Arbitrary precision arithmetic lists some. Google reveals even more.

Upvotes: 1

KingsOfTechENG
KingsOfTechENG

Reputation: 57

You can write a class or struct toencapsulation and may be like BigInt in java

there's an example for you http://hi.baidu.com/lauo1988/item/ed31512ba601e8cddcf69adb

Upvotes: 0

Related Questions