441 {
442 if (mpz_cmp_si(n,2)>=0)
443 {
444 mpz_t r;
445 mpz_init(r);
446 mpz_fdiv_r_ui(r,n,2);
447
450
451 mpz_t m;
452 mpz_init(m);
453
454 if (mpz_cmp_si(r,0) == 0)
455 {
456 mpz_cdiv_q_ui(m,n,2);
457
460 }
461 else
462 {
463 mpz_sub_ui(m,n,1);
464
467 }
468 mpz_clear(r);
469 mpz_clear(m);
470 }
471 else if (mpz_cmp_si(n,1)==0)
472 {
473 mpfi_set(&
result.re,&a.re);
474 mpfi_set(&
result.im,&a.im);
475 }
476 else if (mpz_cmp_si(n,0)==0)
477 {
478 mpfi_set_si(&
result.re,1);
479 mpfi_set_si(&
result.im,0);
480 }
481 else if (mpz_cmp_si(n,0)<0)
482 throw 20;
483 }
void power_mpz(ElementType &result, const ElementType &a, mpz_srcptr n) const
void mult(ElementType &result, const ElementType &a, const ElementType &b) const
void init(ElementType &result) const
VALGRIND_MAKE_MEM_DEFINED & result(result)