Namespace Math.BigInt.iterable
iterable operations
Defined in: <hapint-1_9_2.es>.
Constructor Attributes | Constructor Name and Description |
---|---|
Method Attributes | Method Name and Description |
---|---|
<static> |
Math.BigInt.iterable.isProbablePrime(x, c, interval)
returns an iterator for the interruptible
isProbablePrime . |
<static> |
Math.BigInt.iterable.nextProbablePrime(x, interval)
returns an iterator for the interruptible
nextProbablePrime . |
<static> |
Math.BigInt.iterable.probablePrime(n, rnd, interval)
returns an iterator for the interruptible
probablePrime . |
Method Detail
<static>
{iterator}
Math.BigInt.iterable.isProbablePrime(x, c, interval)
returns an iterator for the interruptible
isProbablePrime
.
- Parameters:
- {number} x
- a BigInt tested
- {number} c
- measure of the certainty. This method returns true when the probability that this BigInt is prime
exceeds
1 - 1 / 2 c
. The execution time of this method is proportional to the value of c. If c is not positive, always returns true. - {(number|Watchdog)} interval
- minimum duration in millisecond that one call of
next()
spend, or a user-created watchdog object.
- Returns:
- {iterator}
iterator.next()
returns a boolean value when the test is finished, otherwise returns the undefined.
<static>
{iterator}
Math.BigInt.iterable.nextProbablePrime(x, interval)
returns an iterator for the interruptible
nextProbablePrime
.
- Parameters:
- {number} x
- a BigInt as the start value
- {(number|Watchdog)} interval
- minimum duration in millisecond that one call of
next()
spend, or a user-created watchdog object.
- Returns:
- {iterator}
iterator.next()
returns a BigInt instance when a solution is found, otherwise returns the undefined.
<static>
{iterator}
Math.BigInt.iterable.probablePrime(n, rnd, interval)
returns an iterator for the interruptible
probablePrime
.
- Parameters:
- {number} n
- bit length of the returned BigInt
- {Random} rnd
- source of random bits used to select candidates to be tested for primality.
A random number generator function compatible with
Math.random
, or an object compatible with Java'sjava.util.Random
that has thenextBytes(byte[])
method, can be accepted. - {(number|Watchdog)} interval
- minimum duration in millisecond that one call of
next()
spend, or a user-created watchdog object.
- Returns:
- {iterator}
iterator.next()
returns a BigInt instance when a solution is found, otherwise returns the undefined.