(38 lines)
1 '\" t2 .\" Copyright (c) 2026 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Int.next_prime 3 2026-01-19 "Tomo man-pages"6 .SH NAME7 Int.next_prime \- get the next prime8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Int.next_prime\ :\ func(x:\ Int\ ->\ Int)13 .fi14 .SH DESCRIPTION15 Finds the next prime number greater than the given integer.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx23 l l l.24 Name Type Description25 x Int The integer after which to find the next prime.26 .TE27 .SH RETURN28 The next prime number greater than `x`.30 .SH NOTES31 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.33 .SH EXAMPLES34 .EX35 assert 11.next_prime() == 1336 .EE37 .SH SEE ALSO38 .BR Tomo-Int (3)