Skip to content

Commit

Permalink
doc for isprime(::BigInt)
Browse files Browse the repository at this point in the history
  • Loading branch information
mschauer committed May 8, 2015
1 parent 5ef01ac commit b7d7bb4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion doc/stdlib/numbers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,18 @@ Integers
julia> isprime(3)
true

.. function:: isprime(x::BigInt, [reps = 25]) -> Bool

Probabilistic primality test. Returns ``true`` if ``x`` is prime; and
``false`` if ``x`` is not prime with high probability. The false positive
rate is about ``0.25^reps``. ``reps = 25`` is considered safe for
cryptographic applications (Knuth, Seminumerical Algorithms).

.. doctest::

julia> isprime(big(3))
true

.. function:: primes(n)

Returns a collection of the prime numbers <= ``n``.
Expand Down Expand Up @@ -458,7 +470,7 @@ As ``BigInt`` represents unbounded integers, the interval must be specified (e.g

``S`` defaults to ``Float64``.

.. function:: rand!([rng], A ,[coll])
.. function:: rand!([rng], A, [coll])

Populate the array A with random values. If the indexable collection ``coll`` is specified, the values are picked randomly from ``coll``. This is equivalent to ``copy!(A, rand(rng, coll, size(A)))`` or ``copy!(A, rand(rng, eltype(A), size(A)))`` but without allocating a new array.

Expand Down

0 comments on commit b7d7bb4

Please sign in to comment.