FLINT3.7.0-dev

n_cbrt, n_cbrtrem

Synopsis#include <flint/ulong_extras.h>
ulong n_cbrt(ulong n)source
ulong n_cbrtrem(ulong * remainder, ulong n)source

Returns \lfloor n^{1/3} \rfloor; n_cbrtrem also sets the remainder.

n_cbrt takes a first approximation from n_cbrt_estimate. For n > 2^{46} the result is computed with n_cbrt_chebyshev_approx; otherwise the iteration x \leftarrow x - (x^3 - a) x / (2 x^3 + a) of Kahan [Kahan1991] is used.

References#

Cite this page

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