Skip to content

Fast implementation of big integer operations in c++

Notifications You must be signed in to change notification settings

RYNO8/BigInt-cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BigInt-cpp

Hahah C++ is BETTER and FASTER than python

Supports:

  • +, ++, +=
  • -, --, -=
  • *, *=
  • .pow
  • <<, <<=
  • >>, >>=
  • |, |=
  • ^, ^=
  • &, &=

Example

compile with g++ -O3 -o output sample.cpp BigInt.cpp

// sample.cpp
#include <iostream>
#include <string>
#include "BigInt.hpp"
using namespace std;

int main() {
	BigInt num1 = (string)"01189998819991197253";
	BigInt num2;

	cin >> num2;
	cout << "Num2 is : " << num2 << "\n";
	cout << num1 + num2 << "\n";
	cout << num1 * num2 << "\n";
	cout << num1 - num2 << "\n";
	cout << num1.pow(num2) << "\n";
}

About

Fast implementation of big integer operations in c++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published