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 n and the prime factors of n found by trial division: the power of 2 and the primes flint_primes[i] with start \le i < start + num_primes. Returns 1 if the remaining cofactor is 1 and 0 otherwise; the cofactor itself is not stored. If n fits in a small fmpz (at most \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-10-20).