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

◆ set_from_mpq()

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

Definition at line 260 of file aring-gf-flint.hpp.

261 {
262 ElementType n, d;
263 init(n);
264 init(d);
265 set_from_mpz(n, mpq_numref(a));
266 set_from_mpz(d, mpq_denref(a));
267 if (is_zero(d)) return false;
268 divide(result, n, d);
269 return true;
270 }
void divide(ElementType &result, const ElementType &a, const ElementType &b) const
fq_zech_struct ElementType
void init(ElementType &result) const
bool is_zero(const ElementType &f) const
void set_from_mpz(ElementType &result, mpz_srcptr a) const
VALGRIND_MAKE_MEM_DEFINED & result(result)

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