Exponentiation. This is the default function, if a class doesn't define this.
Reimplemented from Ring.
Definition at line 549 of file frac.cpp.
550{
552 ring_elem top, bottom;
553 if (mpz_sgn(n) >= 0)
554 {
556 bottom =
R_->power(f->
denom, n);
557
559 }
560 else
561 {
563 {
564 throw exc::division_by_zero_error();
565 }
566 mpz_t abs_n;
567 mpz_init(abs_n);
568 mpz_abs(abs_n, n);
569
570 top =
R_->power(f->
denom, abs_n);
571 bottom =
R_->power(f->
numer, abs_n);
572
573 mpz_clear(abs_n);
574
576 }
577
579}
ring_elem set_non_unit_frac(ring_elem top) const
frac_elem * make_elem(ring_elem a, ring_elem b) const
References frac_elem::denom, FRAC_RINGELEM, FRAC_VAL, make_elem(), frac_elem::numer, R_, and set_non_unit_frac().