No description
include | ||
src | ||
tests | ||
.gitignore | ||
CMakeLists.txt | ||
README.md |
BigNumber
This project aims to be a library to make calculations with a big number (integer or float). The project can be divided in three parts:
- The BigInt class, which represents integers numbers.
- The BigFloat class, which represents floats numbers.
- The big math sub-library, which contains some math functions.
Summary
Usage
- Download the project from GitHub
git clone https://github.com/ocineh/BigNumber.git
- Compile the library:
cmake -S . -B build
cmake --build build
- Include it in your project:
g++ -std=c++17 -o my_program.exe my_program.cpp build/libBigNumber.a
Features
- BigInt
- Comparison operators
- Equalities
- Inequalities
- Greater than
- Less than
- Greater or equal
- Less or equal
- Arithmetic operators
- Addition
- Subtraction
- Multiplication
- Division
- Modulo
- Negation
- Increment (prefix and postfix)
- Decrement (prefix and postfix)
- Bitwise left shift
- Bitwise right shift
- Arithmetic-assignment operators
- Addition assignment
- Subtraction assignment
- Multiplication assignment
- Division assignment
- Modulo assignment
- Bitwise left shift assignment
- Bitwise right shift assignment
- Assignment operators
- Simple assignment with a BigInt
- Simple assignment with a string
- Simple assignment with a
long long
- I/O steam operators
- Input stream
- Output stream
- Methods
- Absolut value
- The length of the number
- If the number is even or odd
- If the number is not a number
- Comparison operators
- BigFloat
- Comparison operators
- Equalities
- Inequalities
- Greater than
- Less than
- Greater or equal
- Less or equal
- Arithmetic operators
- Addition
- Subtraction
- Negation
- Increment (prefix and postfix)
- Decrement (prefix and postfix)
- Bitwise left shift
- Bitwise right shift
- Arithmetic-assignment operators
- Addition assignment
- Subtraction assignment
- Bitwise left shift assignment
- Bitwise right shift assignment
- Assignment operators
- Simple assignment with a BigFloat
- Simple assignment with a string
- Simple assignment with a
long double
- I/O steam operators
- Input stream
- Output stream
- Methods
- Absolut value
- The length of the number
- If the number is not a number
- If the number is zero
- Ceil
- Floor
- Comparison operators
- big math
- Power (Exponentiation)
- Greatest common divisor
- Least common multiple
- Factorial
- Binomial coefficient
- Square root
- Logarithm
- Sine
- Cosine
- Tangent