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

◆ set_from_mpq()

bool M2::ARingGFFlintBig::set_from_mpq ( ElementType & result,
mpq_srcptr a ) const
inline

Definition at line 279 of file aring-gf-flint-big.hpp.

280 {
281 ElementType n, d;
282 init(n);
283 init(d);
284 set_from_mpz(n, mpq_numref(a));
285 set_from_mpz(d, mpq_denref(a));
286 if (is_zero(d)) return false;
287 divide(result, n, d);
288 return true;
289 }
void set_from_mpz(ElementType &result, mpz_srcptr a) const
void divide(ElementType &result, const ElementType &a, const ElementType &b) const
bool is_zero(const ElementType &f) const
void init(ElementType &result) const
VALGRIND_MAKE_MEM_DEFINED & result(result)

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