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

◆ power()

void M2::ARingZZpFlint::power ( ElementType & result,
ElementType a,
long n ) const
inline

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

236 {
237 if (a != 0)
238 {
239 result = n_powmod2_preinv(a, n, mModulus.n, mModulus.ninv);
240 }
241 else
242 {
243 // case a == 0
244 if (n < 0) throw exc::division_by_zero_error();
245 if (n == 0) return set_from_long(result, 1);
246 if (n > 0) return set_zero(result);
247 }
248 }
void set_zero(ElementType &result) const
void set_from_long(ElementType &result, long a) const
VALGRIND_MAKE_MEM_DEFINED & result(result)

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