sci-mathematics/pari: new release + upstream patch
[gentoo.git] / sci-mathematics / pari / files / pari-2.11.3-incorrect_bnfisunit.patch
1 From: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>
2 Date: Mon, 9 Sep 2019 15:20:21 +0000 (+0200)
3 Subject: fix #2164
4 X-Git-Url: https://pari.math.u-bordeaux.fr/cgi-bin/gitweb.cgi?p=pari.git;a=commitdiff_plain;h=c7a1d35f382e96ddf14694be27a0ca5746880700
5
6 fix #2164
7 ---
8
9 diff --git a/src/basemath/buch2.c b/src/basemath/buch2.c
10 index a853d3c48..e31b2278b 100644
11 --- a/src/basemath/buch2.c
12 +++ b/src/basemath/buch2.c
13 @@ -2136,7 +2136,8 @@ bnfisunit(GEN bnf,GEN x)
14    for (i = 1; i < RU; i++)
15      if (gexpo(gel(emb,i)) > -1) break;
16    p1 = imag_i( row_i(logunit,i, 1,RU-1) );
17 -  p1 = RgV_dotproduct(p1, ex); if (!R1) p1 = gmul2n(p1, -1);
18 +  p1 = RgV_dotproduct(p1, ex);
19 +  if (i > R1) p1 = gmul2n(p1, -1);
20    p1 = gsub(garg(gel(emb,i),prec), p1);
21    /* p1 = arg(the missing root of 1) */
22  
23 diff --git a/src/test/32/nf b/src/test/32/nf
24 index 16bf83ce3..e6c41f8b5 100644
25 --- a/src/test/32/nf
26 +++ b/src/test/32/nf
27 @@ -502,6 +502,7 @@ Mod(1/2*x - 1/2, x^2 + 23)
28  [1, 1/2*x - 1/2]
29  Mod(0, x)
30  Mod(-6/5, x)
31 +[0, 2, Mod(0, 2)]~
32    ***   at top-level: nfinit([y^3+2,[1,x]])
33    ***                 ^---------------------
34    *** nfinit: incorrect type in nfinit_basic (t_VEC).
35 diff --git a/src/test/in/nf b/src/test/in/nf
36 index 49148123b..94d5165bc 100644
37 --- a/src/test/in/nf
38 +++ b/src/test/in/nf
39 @@ -156,6 +156,10 @@ K.zk
40  nfinit(x, 3)[2]
41  nfinit(1/2*x + 3/5, 3)[2]
42  
43 +\\ #2164
44 +bnf = bnfinit(y^4-y-1);
45 +bnfisunit(bnf,-y^3+2*y^2-1)
46 +
47  \\ ERRORS: keep at end of file
48  
49  nfinit([y^3+2,[1,x]])