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

◆ power_mpz()

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

Definition at line 250 of file aring-zzp-flint.hpp.

251 {
252 if (a != 0)
253 {
254 unsigned long nbar = mpz_fdiv_ui(n, mCharac - 1);
255 result = n_powmod2_ui_preinv(a, nbar, mModulus.n, mModulus.ninv);
256 }
257 else
258 {
259 // case a == 0
260 if (mpz_sgn(n) == 0)
262 else if (mpz_sgn(n) > 0)
264 else
265 throw exc::division_by_zero_error();
266 }
267 }
void set_zero(ElementType &result) const
void set_from_long(ElementType &result, long a) const
VALGRIND_MAKE_MEM_DEFINED & result(result)

References mCharac, mModulus, result(), set_from_long(), and set_zero().