xte::big_int<T>::pow()

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


Definition

#0
[[nodiscard]] constexpr xte::big_int<T> pow(this auto&&, const xte::big_int<T>& exp) noexcept(false);
Computes the power of a big-integer raised to an exponent. May throw if allocation fails, or if the base is zero and the exponent is negative.

#1
[[nodiscard]] constexpr xte::big_int<T> pow(this auto&&, xte::big_int<T>&& exp) noexcept(false);
Computes the power of a big-integer raised to an exponent. exp is destructively moved-from. May throw if allocation fails, or if the base is zero and the exponent is negative.



Example

std::println("{}", xte::big_int(99).pow(99));
Output:
369729637649726772657187905628805440595668764281741102430259972423552570455277523421410650010128232727940978889548326540119429996769494359451621570193644014418071060667659301384999779999159200499899
[View in Compiler Explorer]