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

◆ subtract()

void M2::ARingGFM2::subtract ( elem & result,
elem a,
elem b ) const
inline

Definition at line 292 of file aring-m2-gf.hpp.

293 {
294 result = a;
295 if (b == 0) return;
296 elem c = modulus_add(b, mGF.minusOne(), mGF.orderMinusOne()); // c = -b
297 add(result, a, c);
298 }
GaloisFieldTable mGF
void add(elem &result, elem a, elem b) const
static int modulus_add(int a, int b, int p)
Arithmetic functions ///////.
VALGRIND_MAKE_MEM_DEFINED & result(result)

References add(), mGF, modulus_add(), and result().

Referenced by subtract_multiple().