Previous Page Next Page Contents

nextprime -- the next prime number

Introduction

nextprime(m) returns the smallest prime number larger than or equal to m.

Call(s)

nextprime(m)

Parameters

m - an arithmetical expression

Returns

a prime number or a symbolic call to nextprime.

Related Functions

ifactor, igcd, ilcm, isprime, ithprime, numlib::prevprime

Details

Example 1

The first prime number is computed:

>> nextprime(-13)
                                     2

If the argument of nextprime is a prime number, this number is returned:

>> nextprime(11)
                                    11

We compute a large prime:

>> nextprime(56475767478567)
                              56475767478601

Symbolic arguments lead to a symbolic call:

>> nextprime(x)
                               nextprime(x)

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000