(40 lines)
1 '\" t2 .\" Copyright (c) 2026 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Int.is_prime 3 2026-01-19 "Tomo man-pages"6 .SH NAME7 Int.is_prime \- check if an integer is prime8 .SH LIBRARY9 Tomo Standard Library10 .SH SYNOPSIS11 .nf12 .BI Int.is_prime\ :\ func(x:\ Int,\ reps:\ Int\ =\ 50\ ->\ Bool)13 .fi14 .SH DESCRIPTION15 Determines if an integer is a prime number.18 .SH ARGUMENTS20 .TS21 allbox;22 lb lb lbx lb23 l l l l.24 Name Type Description Default25 x Int The integer to be checked. -26 reps Int The number of repetitions for primality tests. 5027 .TE28 .SH RETURN29 `yes` if `x` is a prime number, `no` otherwise.31 .SH NOTES32 This function is _probabilistic_. With the default arguments, 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.34 .SH EXAMPLES35 .EX36 assert 7.is_prime() == yes37 assert 6.is_prime() == no38 .EE39 .SH SEE ALSO40 .BR Tomo-Int (3)