Bump S-nail v14.9.25.ar ("Lubimy Gorod"), 2024-06-27
[s-mailx.git] / include / su / prime.h
blob61f5f335470bf3bf1be9f413104eaf7b506a6a4c
1 /*@ Prime numbers.
3 * Copyright (c) 2001 - 2020 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
4 * SPDX-License-Identifier: ISC
6 * Permission to use, copy, modify, and/or distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #ifndef su_PRIME_H
19 #define su_PRIME_H
20 #include <su/code.h>
21 #define su_HEADER
22 #include <su/code-in.h>
23 C_DECL_BEGIN
24 #define su_PRIME_LOOKUP_MIN 0x2u
25 #define su_PRIME_LOOKUP_MAX 0x18000005u
26 EXPORT boole su_prime_is_prime(u64 no, boole allowpseudo);
27 EXPORT u64 su_prime_get_former(u64 no, boole allowpseudo);
28 EXPORT u64 su_prime_get_next(u64 no, boole allowpseudo);
29 EXPORT u32 su_prime_lookup_former(u32 no);
30 EXPORT u32 su_prime_lookup_next(u32 no);
31 C_DECL_END
32 #include <su/code-ou.h>
33 #endif /* su_PRIME_H */
34 /* s-it-mode */