Learn R Programming

gmp (version 0.2-2)

nextprime: Next prime number

Description

Return next prime number geater than n

Usage

nextprime(n)

Arguments

n
An integer, numeric, string or bigz

Value

  • A (probably) prime number

Details

This function uses probabilistic algorithm to identify primes. For practical purposes, it's adequat, the chance of a composit passing will be extremely small.

References

Gnu MP Library see http://swox.com/gmp, Home page: http://mulcyber.toulouse.inra.fr/projects/gmp/

[object Object]

isprime nextprime(14) arith