Karim Belabas on Mon, 08 May 2023 17:15:53 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: p-adic valuation under insufficient p-adic precision


* Max Alekseyev [2023-05-07 14:28]:
> We have for example:
> 
> ? valuation(O(2^3),2)
> %1 = 3
> 
> but in reality we can tell only that the 2-adic valuation here is >= 3.
> Should it instead give an error that the precision is insufficient for
> computing valuation?

The 'PARI object' O(p^n) has a valuation, which is n (just like floating
point zeroes have an exponent). If we consider it instead as a result of
a computation, the mathematical quantity it represents has a p-adic
valuation, which cannot be determined but is >= n.

The valuation() function returns the former, which is a design choice,
with the advantage that it always returns something useful (a proven
lower bound for the valuation) instead of requiring iferr() special
handling to work around possible exceptions.

You can write your own myvaluation() function with the semantics of your
liking and use it instead.

Cheers,

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/