Overview
Correctness
FLINT is used to obtain mathematical results, and a user needs to know how far these results can be trusted. The sections below explain what FLINT promises and what it does not:
- the algorithms are provably correct, except where a function explicitly says otherwise (probable primes, Monte Carlo methods, floating-point approximations), and some answers are allowed to be "unknown" rather than wrong;
- the library is extensively tested, but not formally verified, so results should be checked independently when they matter;
- most functions assume that their input is valid and check nothing, and sizes such as lengths, shifts and precisions are not checked against overflow;
- FLINT is meant for research, education and experimentation; it is not suitable for implementing cryptographic protocols or for processing untrusted input outside a sandbox.
The conventions that define valid input (aliasing, normalisation, the meaning of a leading underscore) are described in Types, naming and aliasing, and the semantics of ball arithmetic, in which every result is a rigorous enclosure, in Ball arithmetic.
In this section#
User guideWhat FLINT guaranteesProvably correct algorithms as the rule; the documented exceptions (probable primes, Monte Carlo methods, conjectures, floating point); randomised algorithms with certified output; and answers that may be "unknown".User guideTesting, bugs and checking resultsHow FLINT is tested, why bugs that give wrong results still occur, how to check results independently, debug builds with assertions, and how to report a bug.User guideInvalid inputWhy most FLINT functions do not check their input, which classes of functions do check (and how they report errors), and typical preconditions that are not checked.User guideSizes and limitsWhy lengths, shift counts, exponents and precisions are not checked for overflow, examples of what goes wrong with huge or negative values, the size limits inherited from GMP, exponent ranges, and what happens when memory runs out.User guideSecurityFLINT is a library for mathematical research, education and experimentation; why it must not be used to implement cryptographic protocols, and why untrusted input should only be processed in a sandbox.
Cite this page
The FLINT team, “Correctness,” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/guide/correctness/index.html (generated 2026-10-20).
@misc{flint-doc-guide-correctness-index,
author = {{The FLINT team}},
title = {{Correctness}},
howpublished = {FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev},
year = {2026},
url = {https://flintlib.org/doc/guide/correctness/index.html},
note = {Generated 2026-10-20}
}