Skip to content

pawan0306/BigInteger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

BigInteger

Big Integer library for c++. Implements basic operations which are described below.

Prerequisites:

  • source code must use namespace std and string header.
  • Every funtion returns the value in the form of string.

Operations available:

Addition

Adds two big integers.
string addition(string, string)

Subtraction

Substracts second paramter from first.
string subtraction(string, string)

Multiplication

Multiplies two big integers
string multiply(string, string)

Divide

Divides two big integers. First parameter is dividend and the second is divisor.
string divide(string, string)

Factorial

Calculates factorial of given integer. Parameter passes must not overflow int.
string factorial(int)

GCD

Calculates GCD of two big integers.
string gcd(string, string)

Fast Exponentiation

Does expoenentiation on given big integer. First parameter is base and the second is expoent value. Exponent value must not overflow long long.
string fast_expo(string, long long)

Conversion from Binary to Decimal

Converts given binary string into its decimal value.
string to_decimal(string)

Conversion from Decimal to Binary

Converts given decimal integer string into binary.
string to_binary(string)

Compare Two Big Integers

Returns true if first parameter is greater than second otherwise false.
bool comp(string, string)

Compare Two Big Integers in Binary

Returns true if first parameter is greater than second otherwise false.
bool bin_comp(string, string)

About

Big Integer library for C++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages