-
Notifications
You must be signed in to change notification settings - Fork 0
c8_natural
Dave Hudson edited this page May 2, 2017
·
5 revisions
c8::natural
is a class designed to represent the natural numbers (zero and all positive whole numbers). Conceptually they behave in a somewhat similar way to unsigned int
, but offer unlimited precision.
- ~natural
- divide_modulus
auto gcd(const natural &v) const -> natural
- is_zero
- size_bits
auto to_unsigned_long_long() const -> unsigned long long
friend auto operator <<(std::ostream &outstr, const natural &v) -> std::ostream &
c8::natural allows us to create two large numbers, subtract one from the other, then output the result to std::cout
:
c8::natural s0("5872489572457574027439274027101850990940275827586671651690897");
c8::natural s1("842758978027689671615847509102945571507457514754190754");
auto s2 = s0 - s1;
std::cout << s2;