Macaulay2 Engine
Loading...
Searching...
No Matches

◆ power_mpz()

void M2::ARingZZ::power_mpz ( ElementType & result,
const ElementType & a,
mpz_srcptr n ) const
inline

Definition at line 227 of file aring-zz-flint.hpp.

230 {
231 if (mpz_sgn(n) < 0) throw exc::engine_error("can only raise to a nonnegative power");
232 std::pair<bool, int> n1 = RingZZ::get_si(n);
233 if (n1.first)
234 fmpz_pow_ui(&result, &a, n1.second);
235 else
236 throw exc::engine_error("exponent too large");
237 }
static std::pair< bool, int > get_si(mpz_srcptr n)
Definition ZZ.cpp:46
VALGRIND_MAKE_MEM_DEFINED & result(result)

References RingZZ::get_si(), and result().