cc.redberry.core.number
Class NumberUtils
- java.lang.Object
-
- cc.redberry.core.number.NumberUtils
-
public final class NumberUtils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field and Description static java.math.BigIntegerTWO_BIG_INT
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static NumericcreateNumeric(double d)static RationalcreateRational(org.apache.commons.math3.fraction.BigFraction fraction)static java.math.BigIntegerfactorial(int n)static booleanisIndeterminate(Complex complex)static booleanisIntegerEven(Complex complex)static booleanisIntegerOdd(Complex complex)static booleanisRealNegative(Complex complex)static booleanisRealNumerical(Tensor tensor)static booleanisSqrt(java.math.BigInteger n, java.math.BigInteger root)static booleanisZeroOrIndeterminate(Complex complex)static java.math.BigIntegerpow(java.math.BigInteger base, java.math.BigInteger exponent)static longpow(long base, long exponent)static java.math.BigIntegersqrt(java.math.BigInteger n)Computes the integer square root of a number.
-
-
-
Method Detail
-
createNumeric
public static Numeric createNumeric(double d)
-
createRational
public static Rational createRational(org.apache.commons.math3.fraction.BigFraction fraction)
-
sqrt
public static java.math.BigInteger sqrt(java.math.BigInteger n)
Computes the integer square root of a number.- Parameters:
n- The number.- Returns:
- The integer square root, i.e. the largest number whose square doesn't exceed n.
-
isSqrt
public static boolean isSqrt(java.math.BigInteger n, java.math.BigInteger root)
-
isIntegerOdd
public static boolean isIntegerOdd(Complex complex)
-
isIntegerEven
public static boolean isIntegerEven(Complex complex)
-
isZeroOrIndeterminate
public static boolean isZeroOrIndeterminate(Complex complex)
-
isIndeterminate
public static boolean isIndeterminate(Complex complex)
-
isRealNegative
public static boolean isRealNegative(Complex complex)
-
isRealNumerical
public static boolean isRealNumerical(Tensor tensor)
-
pow
public static java.math.BigInteger pow(java.math.BigInteger base, java.math.BigInteger exponent)
-
pow
public static long pow(long base, long exponent)
-
factorial
public static java.math.BigInteger factorial(int n)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG