Java

Enhancements to java.math

Documentation Contents
The following enhancement has been made to the java.math package in version 1.4 of the JavaTM 2 SDK.

Performance enhancements for prime generation in BigIntenger

New static method probablePrime has been added to class BigInteger for generating prime numbers. Previously, the sole means of generating a prime BigInteger required the caller to provide a 'certainty' (the log of the probability of compositeness that the caller was willing to tolerate). However, providing an unreasonable value for the certainty could lead to poor performance (if the certainty was too high) or serious bugs (if it was too low). The new prime-generation method provides an efficient algorithm for generating primes using an automatically determined, appropriate value for the certainty based on a draft ANSI specification (X9-80).

Copyright © 2001 Sun Microsystems, Inc. All Rights Reserved.


Please send comments to: j2se-comments@java.sun.com
Sun