FLINT3.7.0-dev

gr_fib_ui, gr_fib_fmpz, gr_fib_vec

Synopsis#include <flint/gr_special.h>
int gr_fib_ui(gr_ptr res, ulong x, gr_ctx_t ctx)source
int gr_fib_fmpz(gr_ptr res, const fmpz_t x, gr_ctx_t ctx)source
int gr_fib_vec(gr_ptr res, slong len, gr_ctx_t ctx)source

Set res to the Fibonacci number F_n, with F_0 = 0 and F_1 = 1; gr_fib_fmpz accepts negative n, with F_{-n} = (-1)^{n+1} F_n.

Cite this page

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