FLINT3.7.0-dev

_gr_poly_set_str, gr_poly_set_str

Synopsis#include <flint/gr_poly.h>
int _gr_poly_set_str(gr_ptr res, const char * s, const char * x, slong len, gr_ctx_t ctx)source
int gr_poly_set_str(gr_poly_t res, const char * s, const char * x, gr_ctx_t ctx)source

Parse a polynomial from the expression s in the variable named x. The underscore version writes exactly len coefficients, zero-padding a shorter result, and returns GR_UNABLE if the parsed polynomial is longer than len (intermediate values may be longer). Returns GR_UNABLE if the string cannot be parsed.

The parser evaluates the expression with polynomial arithmetic and is not optimised for long inputs; it can take time quadratic in the length.

Guides#

Cite this page

The FLINT team, “_gr_poly_set_str, gr_poly_set_str (gr_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/gr_poly/_gr_poly_set_str.html (generated 2026-10-20).