gr_set_str
#include <flint/gr.h>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#
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).
@misc{flint-doc-gr-gr-set-str,
author = {{The FLINT team}},
title = {{gr\_set\_str (gr.h)}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/gr/gr_set_str.html},
note = {Generated 2026-10-20}
}