The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



FindPrimeFactors


Unit: SDL_math1
Class: None
Declaration: function FindPrimeFactors (number: integer): TIntArray;

The function FindPrimeFactors performs a full prime factorization of the integer value number. The function returns an integer array of prime all factors (including the duplicate ones). In the case of an invalid argument (number <2) an empty array is returned.

Example: The statement "anintarray := FindPrimeFactors (1820)" returns the open integer array anintarray filled with the values 2, 2, 5, 7, and 13 since 1820 = 2*2*5*7*13.



Last Update: 2023-Feb-06