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

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


Definitions

#0
[[nodiscard]] friend constexpr std::strong_ordering operator<=>(const xte::big_int<T>& lhs, const xte::big_int<T>& rhs) noexcept;

#1
[[nodiscard]] friend constexpr std::strong_ordering operator<=>(const xte::big_int<T>& lhs, xte::is_int auto rhs) noexcept;

#2
[[nodiscard]] friend constexpr std::partial_ordering operator<=>(const xte::big_int<T>& lhs, xte::is_float auto rhs) noexcept;
The big-integer argument is cast to the floating-point argument's type. May invoke undefined behavior if the floating-point type cannot represent the big-integer's value (i.e. if infinity is not representable).

#3
[[nodiscard]] friend constexpr bool operator==(const xte::big_int<T>&, const xte::big_int<T>&) noexcept = default;

#4
[[nodiscard]] friend constexpr bool operator==(const xte::big_int<T>& lhs, xte::is_int auto rhs) noexcept;

#5
[[nodiscard]] friend constexpr bool operator==(const xte::big_int<T>& lhs, xte::is_float auto rhs) noexcept;
See note for #2. Uses xte::approx_equal() to compare the arguments.



Example

static_assert(xte::big_int(123) == 123);
[View in Compiler Explorer]