aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Int.next_prime.3
blob: ab2c4307c9c706008fa218bd5ab7df2d91910c20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Int.next_prime 3 2025-11-29 "Tomo man-pages"
.SH NAME
Int.next_prime \- get the next prime
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Int.next_prime\ :\ func(x:\ Int\ ->\ Int)
.fi
.SH DESCRIPTION
Finds the next prime number greater than the given integer.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx
l l l.
Name	Type	Description
x	Int	The integer after which to find the next prime. 
.TE
.SH RETURN
The next prime number greater than `x`.

.SH NOTES
This function is _probabilistic_, but the chances of getting an incorrect answer are astronomically small (on the order of 10^(-30)). See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index-mpz_005fprobab_005fprime_005fp) for more details.

.SH EXAMPLES
.EX
assert (11).next_prime() == 13
.EE
.SH SEE ALSO
.BR Tomo-Int (3)