FLINT3.7.0-dev

n_is_square

Synopsis#include <flint/ulong_extras.h>
int n_is_square(ulong x)source

Returns 1 if xx is a perfect square, otherwise 0.

n_is_square first checks that xx is a square modulo 64, 63=32⋅763 = 3^2 \cdot 7 and 65=5⋅1365 = 5 \cdot 13 using lookup tables; only then is a square root taken.

Cite this page

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