FLINT3.7.0-dev

_fmpq_poly_set_str

Synopsis#include <flint/fmpq_poly.h>
int _fmpq_poly_set_str(fmpz * poly, fmpz_t den, const char * str, slong len)source

Sets (poly, den) to the polynomial specified by the null-terminated string str of len coefficients. The input format is a sequence of coefficients separated by one space.

The result is only guaranteed to be in lowest terms if all coefficients in the input string are in lowest terms.

Returns 00 if no error occurred. Otherwise, returns -1 in which case the resulting value of (poly, den) is undefined. If str is not null-terminated, calling this method might result in a segmentation fault.

Cite this page

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-11-02).