Skip to content

Commit

Permalink
sagemathgh-38908: Don't (mis)use prec_words_to_bits()
Browse files Browse the repository at this point in the history
    
We need to remove this function from cypari2, because pari 2.17 has
changed precision from words to bits which would cause confusion.

Besides, the current usage is incorrect, since `log_pari.precision()`
will give the precision in *decimal digits* not in words.

See: sagemath#38749

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
    
URL: sagemath#38908
Reported by: Gonzalo Tornaría
Reviewer(s): Vincent Delecroix
  • Loading branch information
Release Manager committed Nov 14, 2024
2 parents 813f2b5 + e29692d commit 5c8186c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/sage/schemes/elliptic_curves/ell_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@

try:
from sage.libs.pari.all import pari, PariError
from cypari2.pari_instance import prec_words_to_bits
except ImportError:
PariError = ()

Expand Down Expand Up @@ -3807,7 +3806,7 @@ def elliptic_logarithm(self, embedding=None, precision=100,
E_pari = E_work.pari_curve()
log_pari = E_pari.ellpointtoz(pt_pari, precision=working_prec)

while prec_words_to_bits(log_pari.precision()) < precision:
while log_pari.bitprecision() < precision:
# result is not precise enough, re-compute with double
# precision. if the base field is not QQ, this
# requires modifying the precision of the embedding,
Expand Down

0 comments on commit 5c8186c

Please sign in to comment.