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

◆ set_from_mpq()

bool M2::ARingGFM2::set_from_mpq ( elem & result,
mpq_srcptr a ) const
inline

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

227 {
228 elem n, d;
229 set_from_mpz(n, mpq_numref(a));
230 set_from_mpz(d, mpq_denref(a));
231 if (is_zero(d)) return false;
232 divide(result, n, d);
233 return true;
234 }
bool is_zero(ElementType f) const
void divide(elem &result, elem a, elem b) const
void set_from_mpz(elem &result, mpz_srcptr a) const
VALGRIND_MAKE_MEM_DEFINED & result(result)

References divide(), is_zero(), result(), and set_from_mpz().