xte ::big_int {}
Defined in header <xte/math/big_int.hpp> A fully
constexpr arbitrary-precision integer class.Definition
struct big_int {template <xte ::is_arithmetic T =xte ::umax >explicit (!xte ::is_int <T >)constexpr big_int (T =0 )noexcept (false );explicit (false )constexpr big_int (const xte ::big_int & )noexcept (false ) =default ;explicit (false )constexpr big_int (xte ::big_int && )noexcept =default ;template <typename Range =xte ::array <xte ::umax >>constexpr big_int (std ::from_range_t ,Range && ,bool =false )XTE_CONSTRUCTS (/* ... */ )template <xte ::is_int Radix =xte ::uz >explicit constexpr big_int (xte ::string_view ,Radix =10 ,const xte ::number_format_config & = {})noexcept (false );constexpr xte ::big_int & operator= (const xte ::big_int & )& noexcept (false ) =default ;constexpr xte ::big_int & operator= (xte ::big_int && )& noexcept =default ;template <xte ::is_arithmetic T >explicit constexpr operator T ()const noexcept ;explicit constexpr operator bool ()const noexcept ;friend constexpr std ::strong_ordering operator<=> (const xte ::big_int & ,const xte ::big_int & )noexcept ;friend constexpr std ::strong_ordering operator<=> (const xte ::big_int & ,xte ::is_int auto )noexcept ;friend constexpr std ::partial_ordering operator<=> (const xte ::big_int & ,xte ::is_float auto )noexcept ;friend constexpr bool operator== (const xte ::big_int & ,const xte ::big_int & )noexcept =default ;friend constexpr bool operator== (const xte ::big_int & ,xte ::is_int auto )noexcept ;friend constexpr bool operator== (const xte ::big_int & ,xte ::is_float auto )noexcept ;constexpr auto&& operator+ (this auto&& )noexcept ;friend constexpr xte ::big_int operator+ (xte ::big_int ,const xte ::big_int & )noexcept (false );friend constexpr xte ::big_int operator+ (xte ::big_int ,xte ::big_int && )noexcept (false );constexpr xte ::big_int & operator+= (const xte ::big_int & )& noexcept (false );constexpr xte ::big_int & operator+= (xte ::big_int && )& noexcept (false );constexpr xte ::big_int & operator++ ()& noexcept (false );constexpr xte ::big_int & operator++ (int )& noexcept (false );constexpr xte ::big_int operator- ()const & noexcept (false );constexpr xte ::big_int && operator- ()&& noexcept ;friend constexpr xte ::big_int operator- (xte ::big_int ,const xte ::big_int & )noexcept (false );friend constexpr xte ::big_int operator- (xte ::big_int ,xte ::big_int && )noexcept (false );constexpr xte ::big_int & operator-= (const xte ::big_int & )& noexcept (false );constexpr xte ::big_int & operator-= (xte ::big_int && )& noexcept (false );constexpr xte ::big_int & operator-- ()& noexcept (false );constexpr xte ::big_int & operator-- (int )& noexcept (false );friend constexpr xte ::big_int operator* (xte ::big_int ,const xte ::big_int & )noexcept (false );friend constexpr xte ::big_int operator* (xte ::big_int ,xte ::big_int && )noexcept (false );constexpr xte ::big_int & operator*= (const xte ::big_int & )& noexcept (false );constexpr xte ::big_int & operator*= (xte ::big_int && )& noexcept (false );friend constexpr xte ::big_int operator/ (xte ::big_int ,const xte ::big_int & )noexcept (false );constexpr xte ::big_int & operator/= (const xte ::big_int & )& noexcept (false );friend constexpr xte ::big_int operator% (xte ::big_int ,const xte ::big_int & )noexcept (false );constexpr xte ::big_int & operator%= (const xte ::big_int & )& noexcept (false );constexpr auto operator~ (this auto&& )noexcept (false );friend constexpr xte ::big_int operator& (xte ::big_int ,xte ::big_int )noexcept (false );constexpr xte ::big_int & operator&= (xte ::big_int )& noexcept (false );friend constexpr xte ::big_int operator| (xte ::big_int ,xte ::big_int )noexcept (false );constexpr xte ::big_int & operator|= (xte ::big_int )& noexcept (false );friend constexpr xte ::big_int operator^ (xte ::big_int ,xte ::big_int )noexcept (false );constexpr xte ::big_int & operator^= (xte ::big_int )& noexcept (false );friend constexpr xte ::big_int operator<< (xte ::big_int ,const xte ::big_int & )noexcept (false );constexpr xte ::big_int & operator<<= (const xte ::big_int & )& noexcept (false );friend constexpr xte ::big_int operator>> (xte ::big_int ,const xte ::big_int & )noexcept (false );constexpr xte ::big_int & operator>>= (const xte ::big_int & )& noexcept (false );constexpr auto abs (this auto&& )XTE_RETURNS (/* ... */ )constexpr xte ::big_int pow (this auto&& ,const xte ::big_int & )noexcept (false );constexpr xte ::big_int pow (this auto&& ,xte ::big_int && )noexcept (false );constexpr xte ::big_int root (const xte ::big_int & )const noexcept (false );constexpr xte ::big_int log (const xte ::big_int & )const noexcept (false );static constexpr struct {/* ... */ }parse ;template <xte ::is_int Radix =xte ::uz >constexpr xte ::string str (this auto&& ,Radix =10 ,const xte ::number_format_config & = {})noexcept (false ); };
Literal suffix
namespace literal ::big_int {template <char... >constexpr xte ::big_int operator"" _big ()noexcept (false ); }
Specialization for formatting
template <>struct std ::formatter <xte ::big_int >;
Example
Output:std ::println ("{}" ,xte ::big_int (99 ).pow (99 ));
[View in Compiler Explorer]369729637649726772657187905628805440595668764281741102430259972423552570455277523421410650010128232727940978889548326540119429996769494359451621570193644014418071060667659301384999779999159200499899