+2003-04-19 Jerry Quinn <jlquinn@optonline.net>
+
+ * java/math/BigInteger.java (probablePrime): New.
+ * java/math/BigDecimal.java (unscaledValue): New.
+
2003-04-19 Ranjit Mathew <rmathew@hotmail.com>
* java/io/File.java (getAbsolutePath): On Windows, take care
}
}
+ /**
+ * Return a BigInteger that is bitLength bits long with a
+ * probability < 2^-100 of being composite.
+ *
+ * @param bitLength length in bits of resulting number
+ * @param rnd random number generator to use
+ * @throws ArithmeticException if bitLength < 2
+ * @since 1.4
+ */
+ public static BigInteger probablePrime(int bitLength, Random rnd)
+ {
+ if (bitLength < 2)
+ throw new ArithmeticException();
+
+ return new BigInteger(bitLength, 100, rnd);
+ }
+
/** Return a (possibly-shared) BigInteger with a given long value. */
public static BigInteger valueOf(long val)
{