Class Roots
java.lang.Object
edu.jas.arith.Roots
Root computation algorithms. Roots for BigInteger and BigDecimals.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BigDecimalroot(BigDecimal A, int n) N-th root.static BigIntegerroot(BigInteger A, int n) Integer n-th root.static BigComplexsqrt(BigComplex A) Square root.static BigDecimalsqrt(BigDecimal A) Square root.static BigDecimalComplexComplex decimal number square root.static BigIntegersqrt(BigInteger A) Integer square root.static BigRationalsqrt(BigRational A) Square root.static BigIntegerInteger square root.
-
Constructor Details
-
Roots
public Roots()
-
-
Method Details
-
root
Integer n-th root. Uses BigDecimal and newton iteration. R is the n-th root of A.- Parameters:
A- big integer.n- long.- Returns:
- the n-th root of A.
-
sqrt
Integer square root. Uses BigDecimal and newton iteration. R is the square root of A.- Parameters:
A- big integer.- Returns:
- the square root of A.
-
sqrtInt
Integer square root. Uses BigInteger only. R is the square root of A.- Parameters:
A- big integer.- Returns:
- the square root of A.
-
sqrt
Square root. R is the square root of A.- Parameters:
A- big decimal.- Returns:
- the square root of A.
-
root
N-th root. R is the n-th root of A.- Parameters:
A- big decimal.n- long.- Returns:
- the n-th root of A.
-
sqrt
Complex decimal number square root.- Parameters:
a- big decimal complex.- Returns:
- sqrt(a).
-
sqrt
Square root. R is the square root approximation of A. Convert to BigDecimal and compute square root.- Parameters:
A- big rational.- Returns:
- the square root approximation of A.
-
sqrt
Square root. R is the square root approximation of A. Convert to BigDecimalComplex and compute square root.- Parameters:
A- big complex rational.- Returns:
- the square root approximation of A.
-