Examples & tutorials
The examples on function pages are deliberately minimal: they show one function at work. The tutorials in this chapter are longer. Each one solves a small but realistic problem, explains the mathematics behind it and the choices made in the code, and points to the reference documentation and the algorithm pages for details. The programs are complete: they can be compiled and linked as shown in A first program. The documentation checks compile and run every program and compare its output with the output shown.
FLINT's source tree also contains a directory examples of larger programs: command-line tools, demonstrations and benchmarks, some of which were used for record computations. They are described in The example programs, and several tutorials explain the techniques they use with shorter programs.
The tutorials are grouped by topic:
- Getting started: a first program with integers and polynomials, compiling and linking, a program that combines several modules, and the example programs shipped with FLINT. If FLINT is new to you, start with A first program.
- Integers and number theory: integers, primes, modular arithmetic and elliptic curves.
- Polynomials and algebra: programs built on polynomial arithmetic, such as error-correcting codes over finite fields.
- Linear algebra: matrix computations over exact rings.
- Rigorous numerics: rigorous numerical computation with ball arithmetic: constants to many digits, special functions, roots of functions and polynomials, integrals and the zeros of the Riemann zeta function.
- Exact computation: exact computation with algebraic numbers and exact real and complex numbers.
The tutorials assume some familiarity with C and with the mathematics of their topic, but not with FLINT. For the conventions that all modules share (types, memory management, aliasing, threading) see Conventions; for the meaning of the results of ball arithmetic see Ball arithmetic.
Getting started
First programs with FLINT: integers, polynomials and matrices, compiling and linking, and the example programs shipped with FLINT.
Integers and number theory
Programs that compute with integers, primes, modular arithmetic and elliptic curves.
Polynomials and algebra
Programs built on polynomial arithmetic: codes, factorisation, finite fields.
Linear algebra
Programs built on matrix arithmetic over exact rings.
Rigorous numerics
Programs that compute with balls: constants, special functions, roots, integrals and zeta zeros, with guaranteed error bounds and adaptive precision.
Exact computation
Programs that compute with algebraic and exact real and complex numbers.
The FLINT team, “Examples & tutorials,” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/tutorials/index.html (generated 2026-10-20).
@misc{flint-doc-tutorials-index,
author = {{The FLINT team}},
title = {{Examples \& tutorials}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/tutorials/index.html},
note = {Generated 2026-10-20}
}