FLINT3.7.0-dev

fmpz_factor_trial_range

Synopsis#include <flint/fmpz_factor.h>
int fmpz_factor_trial_range(fmpz_factor_t factor, const fmpz_t n, ulong start, ulong num_primes)source

Sets factor to the sign of nn and the prime factors of nn found by trial division: the power of 2 and the primes flint_primes[i] with start ≤i<\le i < start + num_primes. Returns 1 if the remaining cofactor is 1 and 0 otherwise; the cofactor itself is not stored. If nn fits in a small fmpz (at most FLINT_BITS−2\mathtt{FLINT\_BITS} - 2 bits), it is instead factored completely, and 1 is returned.

Cite this page

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