FLINT3.7.0-dev

ca_pow_fmpq, ca_pow_fmpz, ca_pow_ui, ca_pow_si, ca_pow

Synopsis#include <flint/ca.h>
void ca_pow_fmpq(ca_t res, const ca_t x, const fmpq_t y, ca_ctx_t ctx)source
void ca_pow_fmpz(ca_t res, const ca_t x, const fmpz_t y, ca_ctx_t ctx)source
void ca_pow_ui(ca_t res, const ca_t x, ulong y, ca_ctx_t ctx)source
void ca_pow_si(ca_t res, const ca_t x, slong y, ca_ctx_t ctx)source
void ca_pow(ca_t res, const ca_t x, const ca_t y, ca_ctx_t ctx)source

Sets res to xyx^y, with the principal branch xy=exp⁡(ylog⁡x)x^y = \exp(y \log x) for non-integer yy.

Integer powers of rational numbers and of number field elements are computed exactly unless the size of the result would exceed about CA_OPT_PREC_LIMIT bits; in generic fields, xnx^n is expanded by repeated multiplication for ∣n∣≤|n| \le CA_OPT_POW_LIMIT. Exponents n/2n/2 are computed via ca_sqrt, and (za)b(z^a)^b is simplified to zabz^{ab} when this is valid. Otherwise the result is the generator of a new field Q(xy)\mathbb{Q}(x^y), which requires that xx is proved nonzero unless yy is a positive rational number; if that fails, the result is Unknown.

For special bases and integer exponents nn: ∞~n\tilde \infty^n is ∞~\tilde \infty, 0 or Undefined for n>0n > 0, n<0n < 0 and n=0n = 0; (c∞)n=cn∞(c \infty)^n = c^n \infty for n>0n > 0, 0 for n<0n < 0 and Undefined for n=0n = 0; 0n=∞~0^n = \tilde \infty for n<0n < 0. Non-integer powers involving special values give Unknown.

Cite this page

The FLINT team, “ca_pow_fmpq, ca_pow_fmpz, ca_pow_ui, ca_pow_si, ca_pow (ca.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/ca/ca_pow_fmpq.html (generated 2026-11-02).