Integer Math.Factorize Method
Definition
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Factorize( |
Returns the prime factors of an integer.
Obsolete. |
Factorize( |
Returns the prime factors of a long (64-bit) integer.
Obsolete. |
Factorize(Int32)
[ObsoleteAttribute("Use the factor method instead.")]
public static int[] Factorize(
int n
)
Parameters
- n Int32
- An integer greater than zero.
Return Value
Int32[]An integer array containing the prime factors of n in ascending order.
Remarks
This method uses a simple trial divide algorithm to look for small prime factors. It then switches to Pollard's Rho algorithm to find any large prime factors of n with the known factors divided out. If this number is prime, the algorithm may take a long term to finish.
Exceptions
Argument | n is less than or equal to zero. |
Factorize(Int64)
[ObsoleteAttribute("Use the factor method instead.")]
public static long[] Factorize(
long n
)
Parameters
- n Int64
- A 64-bit integer greater than zero.
Return Value
Int64[]A 64-bit integer array containing the prime factors of n in ascending order.
Remarks
This method uses a simple trial divide algorithm to look for small prime factors. It then switches to Pollard's Rho algorithm to find any large prime factors of n with the known factors divided out. If this number is prime, the algorithm may take a long term to finish.
This method breaks down when the Rho algorithm is invoked for values larger than 248. No further decomposition is attempted. Instead, this number is returned as the last factor.
Exceptions
Argument | n is less than or equal to zero. |