Skip to content
/ Num Public

Single file header only C++ implementation of BigInteger / BigNum / unlimited size integers and rational numbers

License

Notifications You must be signed in to change notification settings

983/Num

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Num

Single file header only C++ implementation of BigInteger / BigNum / unlimited size integers and rational numbers

Supported operations on Num type:

Artithmetic: +, -, *, /, +=, -=, *=, /=, %=

Comparison: ==, !=, <=, >=, <, >

Bit ops: get_bit, set_bit, clr_bit

Shifts: <<, >>, <<=, >>=

Fancy stuff: gcd, sqrt, pow, mod_pow, div_mod

Base conversion:

Num a("539", 16);

std::vector<char> c;
a.print(c, 2);
puts(&c[0]); // 10100111001

For more examples, e.g. calculating digits of Pi and e, see tests.cpp.

About

Single file header only C++ implementation of BigInteger / BigNum / unlimited size integers and rational numbers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages