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

◆ divide()

void M2::ARingZZp::divide ( elem & result,
elem a,
elem b ) const
inline

Definition at line 277 of file aring-zzp.hpp.

278 {
279 if (b == 0)
280 throw exc::division_by_zero_error();
281 if (a != 0)
282 {
283 int c = a - b;
284 if (c <= 0) c += p1;
285 result = c;
286 }
287 else
288 result = 0;
289 }
VALGRIND_MAKE_MEM_DEFINED & result(result)

References p1, and result().

Referenced by set_from_mpq(), and syzygy().