Num
Num copied to clipboard
Single file header only C++ implementation of BigInteger / BigNum / unlimited size integers and rational numbers
Several errors while build in visual studio 2019: 1>D:\cpptest\num.hpp(230): error C2589: “(”:“::” 230 ` size_t i, na = a.size(), nb = b.size(), n = std::max(na, nb);`
Fixes #5. The original code (`#undef max`) for the fix was made by @Botje, with a check to see if `windows.h` is available added by me.
I understand `Num `can store really big integers. However, sometimes it can store a small number. In this scenario, what would be the best way to convert `Num` to a...
Sorry to complain, I just wanted to give a bit of constructive criticism. Very simple code: ``` c++ Num um(1); uint64_t collatz(Num num) { uint64_t steps(0); for(;;) { if (num.is_odd())...
I have a 512 bit number which may be very large or very small (like just 1), but still occupies 8 × uint64_t values. Want to compute a division like...
This assert fails. ``` #include #include "../Num/rat.hpp" using namespace std; int main(int argc, const char * argv[]) { const auto large = Rat(24, 1); const auto small = Rat(71, 3);...