FLINT3.7.0-dev

fmpq_get_str, _fmpq_get_str

Synopsis#include <flint/fmpq.h>
char * fmpq_get_str(char * str, int b, const fmpq_t x)source
char * _fmpq_get_str(char * str, int b, const fmpz_t num, const fmpz_t den)source

Write x in base b \in [2, 36] as "p/q", or as "p" if the denominator is 1. If str is NULL, a buffer is allocated with flint_malloc (to be freed with flint_free) and returned; otherwise str must have room for the digits of both components plus three characters, and is returned.

Cite this page

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