Share via


BigInteger.IsProbablePrime(Int32) Method

Definition

Returns true if this BigInteger is probably prime, false if it's definitely composite.

[Android.Runtime.Register("isProbablePrime", "(I)Z", "GetIsProbablePrime_IHandler")]
public virtual bool IsProbablePrime (int certainty);
[<Android.Runtime.Register("isProbablePrime", "(I)Z", "GetIsProbablePrime_IHandler")>]
abstract member IsProbablePrime : int -> bool
override this.IsProbablePrime : int -> bool

Parameters

certainty
Int32

a measure of the uncertainty that the caller is willing to tolerate: if the call returns true the probability that this BigInteger is prime exceeds (1 - 1/2<sup>certainty</sup>). The execution time of this method is proportional to the value of this parameter.

Returns

true if this BigInteger is probably prime, false if it's definitely composite.

Attributes

Remarks

Returns true if this BigInteger is probably prime, false if it's definitely composite. If certainty is &le; 0, true is returned.

Java documentation for java.math.BigInteger.isProbablePrime(.*int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to