@Status(stage=PRODUCTION, unitTests=COMPLETE) @Review(by="Kees Schotanus", at="2009-10-16", reason="Initial review") @ThreadSafety(level=IMMUTABLE) public final class PrimeFactor extends Object
Modifier and Type | Method and Description |
---|---|
static List<PrimeFactor> |
factorize(BigInteger value)
Factorizes the supplied BigInteger value into its prime factors.
|
static List<PrimeFactor> |
factorize(long value)
Factorizes the supplied long value into its prime factors.
|
int |
getExponent()
Gets the exponent of this PrimeFactor.
|
BigInteger |
getPrimeNumber()
Gets the prime number of this PrimeFactor.
|
String |
toString()
Creates a String representation of this PrimeFactor.
|
public BigInteger getPrimeNumber()
public int getExponent()
public static List<PrimeFactor> factorize(BigInteger value)
Long.MAX_VALUE
you are better of
using factorize(long)
.value
- The value to factorize.ArithmeticException
- When the supplied value is < 2.NullPointerException
- When the supplied value is null.public static List<PrimeFactor> factorize(long value)
value
- The value to factorize.ArithmeticException
- When the supplied value is < 2.NullPointerException
- When the supplied value is null.Copyright © 2008–2018. All rights reserved.