FLINT3.7.0-dev

gr_set_str

Synopsis#include <flint/gr.h>
int gr_set_str(gr_ptr res, const char * x, gr_ctx_t ctx)source

Sets res to the value of the expression x, parsed by gr_generic_set_str unless the ring overrides it. Expressions may use integer and decimal literals (2.5e-3, converted with gr_set_fmpz_10exp_fmpz), + - * / ^, parentheses, the generators of the ring and its base rings by name, the constants pi, i, inf and nan, functions such as sqrt, exp, log and gamma, ball notation m +/- r, and O(x^n) in series rings; see gr_generic_set_str_expr. Returns GR_UNABLE if the string cannot be parsed and propagates the status of the arithmetic (for example GR_DOMAIN for "1/2" in \mathbb{Z}).

Guides#

Cite this page

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