fmpq_poly_set_str
#include <flint/fmpq_poly.h>int fmpq_poly_set_str(fmpq_poly_t poly, const char * str)sourceSets poly to the polynomial specified by the null-terminated string str. The input format is the same as the output format of fmpq_poly_get_str: the length given as a decimal integer, then two spaces, then the list of coefficients separated by one space.
The result is only guaranteed to be in canonical form if all coefficients in the input string are in lowest terms.
Returns 0 if no error occurred. Otherwise, returns -1 in which case the resulting value of poly is set to zero. If str is not null-terminated, calling this method might result in a segmentation fault.
Guides#
The FLINT team, “fmpq_poly_set_str (fmpq_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpq_poly/fmpq_poly_set_str.html (generated 2026-10-20).
@misc{flint-doc-fmpq-poly-fmpq-poly-set-str,
author = {{The FLINT team}},
title = {{fmpq\_poly\_set\_str (fmpq\_poly.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/fmpq_poly/fmpq_poly_set_str.html},
note = {Generated 2026-10-20}
}