xte::big_int<T>::operator-=()

Defined in header <xte/math/big_int.hpp>


Definitions

#0
constexpr xte::big_int<T>& operator-=(const xte::big_int<T>& rhs) & noexcept(false);
Subtracts rhs from the big-integer. May throw if allocation fails.

#1
constexpr xte::big_int<T>& operator-=(xte::big_int<T>&& rhs) & noexcept(false);
Subtracts rhs from the big-integer. lhs is destructively moved-from. May throw if allocation fails.



Example

constexpr auto i64_max = 9223372036854775807;
constexpr auto i64_min = -i64_max - 1;
xte::big_int n = u64_min;
n -= u64_max;
std::println("{}", n);
Output:
-18446744073709551615
[View in Compiler Explorer]