diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-03-21 16:19:59 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-03-21 16:19:59 -0400 |
| commit | ac3a02b80bf78c4212eab930243c1a2e0ca9c728 (patch) | |
| tree | 4545c421c3a843b5abc5d2e99d8a902fe4f36731 /stdlib/integers.c | |
| parent | 0ef96cb3c0d79ecd1ca4a1f04b58ee6dd0e03586 (diff) | |
Add version check for GNU MP's prev_prime()
Diffstat (limited to 'stdlib/integers.c')
| -rw-r--r-- | stdlib/integers.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/stdlib/integers.c b/stdlib/integers.c index c4fcdfb5..4d5d0a80 100644 --- a/stdlib/integers.c +++ b/stdlib/integers.c @@ -409,6 +409,8 @@ public Int_t Int$next_prime(Int_t x) return Int$from_mpz(p); } +#if __GNU_MP_VERSION >= 6 +#if __GNU_MP_VERSION_MINOR >= 3 public Int_t Int$prev_prime(Int_t x) { mpz_t p; @@ -417,6 +419,8 @@ public Int_t Int$prev_prime(Int_t x) fail("There is no prime number before %k", (Text_t[1]){Int$as_text(&x, false, &Int$info)}); return Int$from_mpz(p); } +#endif +#endif public Int_t Int$choose(Int_t n, Int_t k) { |
