From ab46e1f72f2c3066b17d9884fd271ea6de027c88 Mon Sep 17 00:00:00 2001 From: Claus Fieker Date: Thu, 21 Sep 2023 10:30:46 +0200 Subject: [PATCH] "fix" precision settings solves Tommy's log problem Underlying problem: map_coefficients is clever: a zero coefficient is mapped to zero(target), thus when applying it with x->setprecision(x, new) the target precision is ignored and the ring precision is used instead --- src/LocalField/Elem.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LocalField/Elem.jl b/src/LocalField/Elem.jl index 798a89abcb..7d7c54720f 100644 --- a/src/LocalField/Elem.jl +++ b/src/LocalField/Elem.jl @@ -693,7 +693,9 @@ function Base.:(^)(a::LocalFieldElem, n::Int) e = absolute_ramification_index(parent(a)) v = valuation(n, prime(parent(a))) if v > 0 - b = setprecision(a.data, precision(a.data)+v) + b = setprecision(base_ring(a.data), precision(a.data)+v) do + setprecision(a.data, precision(a.data)+v) + end else b = a.data end