List of utility methods to do BigInteger Calculate
Number | decodeFloat(BigInteger rawSign, BigInteger rawExponent, BigInteger rawMantissa, int signWidth, int exponentWidth, int mantissaWidth, int bias, MathContext mc) decode Float if (signWidth < 0 || signWidth > 1 || exponentWidth < 0 || mantissaWidth < 0) throw new IllegalArgumentException(); else if (rawExponent.compareTo(BigInteger.ZERO) == 0) { if (rawMantissa.compareTo(BigInteger.ZERO) == 0) { boolean isNegative = (rawSign.compareTo(BigInteger.ZERO) != 0); return isNegative ? -0.0 : 0.0; } else { boolean isNegative = (rawSign.compareTo(BigInteger.ZERO) != 0); ... |
BigInteger | decodeToBigInteger(String input) decode To Big Integer return new BigInteger(1, decode(input)); |
BigInteger[] | DiffieHellman(BigInteger p, BigInteger g, BigInteger x, BigInteger y, BigInteger y_B) Diffie Hellman if (y == null) y = g.modPow(x, p); BigInteger k = null; if (y_B != null) k = y_B.modPow(x, p); return new BigInteger[] { y, k }; |
int | distance(BigInteger a, BigInteger b) distance int ia = a.intValue(); int ib = b.intValue(); if (ib >= ia) return ib - ia; return ib + (int) Math.pow(2, M) - ia; |
BigInteger | distance(BigInteger a, BigInteger b) return the distance between two number, that is |a-b|. return a.subtract(b).abs();
|
BigInteger | div(BigInteger dividend, BigInteger divisor) div return dividend.divide(divisor);
|
BigInteger | divide(BigInteger dividend, BigInteger divisor) Divides the given dividend by the divisor. BigInteger result = null; if (dividend != null && divisor != null) { result = dividend.divide(divisor); return result; |
String | dump(BigInteger x) Returns a hexadecimal dump of the trimmed bytes of a BigInteger . return dumpString(trim(x));
|
void | dumpBitLengthOfValues(BigInteger... data) dump Bit Length Of Values System.out.println("Bitlengths:"); for (BigInteger bigInt : data) { System.out.println(bigInt.bitLength()); |
String | dumpDataPathId(BigInteger datapathId) dump Data Path Id return datapathId.toString(16);
|