Packagegraphics.numeric
Classpublic final class Prime
InheritancePrime Inheritance Object

Implements the static behaviours of the Prime Class.



Public Methods
 MethodDefined By
  
findPrimeFrom(n:int, from:uint = 0):Array
[static] Defines an array of all primes between 'from' and 'n' inclusive, positive but restricted integer value, ignores decimals.
Prime
  
generatePrimes(limit:Number):Array
[static] Defines an array of all primes between 2 and 'n' inclusive.
Prime
  
isPrime(n:int):Boolean
[static] Boolean for 'isPrime' integer condition, ignores decimals.
Prime
  
primeFactor(n:Number):String
[static] Defines prime factors of 'n', positive but restricted integer value, ignores decimals.
Prime
  
totient(n:Number):Number
[static] Defines total of relative primes of 'n'.
Prime
Method Detail
findPrimeFrom()method
public static function findPrimeFrom(n:int, from:uint = 0):Array

Defines an array of all primes between 'from' and 'n' inclusive, positive but restricted integer value, ignores decimals.

Parameters

n:int
 
from:uint (default = 0)

Returns
Array — a array representation of all primes between from and n inclusive}
generatePrimes()method 
public static function generatePrimes(limit:Number):Array

Defines an array of all primes between 2 and 'n' inclusive.

Parameters

limit:Number

Returns
Array
isPrime()method 
public static function isPrime(n:int):Boolean

Boolean for 'isPrime' integer condition, ignores decimals. Successive division.

Parameters

n:int

Returns
Boolean
primeFactor()method 
public static function primeFactor(n:Number):String

Defines prime factors of 'n', positive but restricted integer value, ignores decimals.

Parameters

n:Number

Returns
String — a string representation of the multiplication of primes of 'n'.
totient()method 
public static function totient(n:Number):Number

Defines total of relative primes of 'n'.

Parameters

n:Number

Returns
Number