Skip to content

Commit f5c1242

Browse files
yyyyx4dimpase
authored andcommitted
add patch for PARI bug #2466
1 parent d2f8fff commit f5c1242

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

build/pkgs/pari/patches/bug2466.patch

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 7ca0c2eae87def89fa7253c60e4791a8ef26629d Mon Sep 17 00:00:00 2001
2+
From: Bill Allombert <[email protected]>
3+
Date: Mon, 3 Apr 2023 15:30:26 +0200
4+
Subject: [PATCH] quadunitindex(8461,2)->1 instead of 3 [#2466]
5+
6+
---
7+
src/basemath/quad.c | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/src/basemath/quad.c b/src/basemath/quad.c
11+
index 021a404b00..7ed554c2f3 100644
12+
--- a/src/basemath/quad.c
13+
+++ b/src/basemath/quad.c
14+
@@ -359,7 +359,7 @@ quadunit_mod(GEN D, GEN N)
15+
GEN M = shifti(mulii(q, N), 1);
16+
quadunit_uvmod(D, d, M, &u, &v);
17+
u = diviiexact(u, q);
18+
- v = diviiexact(v, q); u = shifti(u,-1);
19+
+ v = modii(diviiexact(v, q), N); u = shifti(u,-1);
20+
}
21+
return deg1pol_shallow(v, u, 0);
22+
}
23+
--
24+
2.40.0
25+

src/sage/rings/number_field/order.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,14 @@ def class_number(self, proof=None):
10831083
NotImplementedError: computation of class numbers of non-maximal orders
10841084
not in quadratic fields is not implemented
10851085
1086+
TESTS:
1087+
1088+
Test for PARI bug #2466::
1089+
1090+
sage: x = polygen(ZZ)
1091+
sage: R.<t> = EquationOrder(x^2 - 8461)
1092+
sage: R.class_number()
1093+
3
10861094
"""
10871095
if not self.is_maximal():
10881096
K = self.number_field()

0 commit comments

Comments
 (0)