Re: t_PADIC to t_INTMOD and use of chinese()
Max Alekseyev <[email protected]>
| Newsgroups | gmane.comp.mathematics.pari.user |
|---|---|
| Message-ID | <CAJkPp5Mt_cgqsqowTfTCM=bsvCVH5Y2+YMa=O_zGXHMkRmZ3Wg@mail.gmail.com> |
Hi Karim, I have already written my own code addressing those issues, but I believe it'd be beneficial to have built-in support for that conversion and application of chinese(). Hence, I posted those requests here. Btw, padic2mod(x) = Mod(x, x.mod); looks a bit more straightforward. Regards, Max On Fri, Feb 14, 2025 at 9:31 AM Karim Belabas < [email protected]> wrote: > * Max Alekseyev [2025-02-14 15:09]: > > dueHello, > > > > I have a couple of requests: > > > > 1) An easy way to convert t_PADIC to t_INTMOD, maybe extending Mod() to > > support a single argument of type t_PADIC, e.g. Mod(1 + O(5^2)) would > > produce Mod(1, 25). > > padic2mod(x) = Mod(x, x.p^padicprec(x, x.p)); > > ? padic2mod(1+O(5^2)) > %1 = Mod(1, 25) > > ? padic2mod(5+O(5^2)) > %2 = Mod(5, 25) > > ? padic2mod(1/5+O(5^2)) > *** Mod: inconsistent t_PADIC , t_INTMOD. > > > 2) Extend chinese() to support t_PADIC arguments (still producing > t_INTMOD). > > padicchinese(v) = chinese(apply(padic2mod, v)) > > ? padicchinese([1 + O(5^2), 3 + O(3^3)]) > %3 = Mod(651, 675) > > 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/ >