# Suggestion for printing padic values

12 views

### Ed Scheinerman

Aug 11, 2020, 9:12:34 AM8/11/20
to nemo-devel
For interacitve use, I would find it helpful if padic values were able to be represented like this: …266421216213

I've written some basic code to make that happen (see attached) though I imagine there's a more elegant way to handle this.

Example:

julia> using Nemo

Welcome to Nemo version 0.18.0

Nemo comes with absolutely no warranty whatsoever

julia> sqrt(F(2))

3 + 1*7^1 + 2*7^2 + 6*7^3 + 1*7^4 + 2*7^5 + 1*7^6 + 2*7^7 + 4*7^8 + 6*7^9 + 6*7^10 + 2*7^11 + O(7^12)

julia> sqrt(F(2))

…266421216213

### tho...@gmail.com

Aug 11, 2020, 9:30:34 AM8/11/20
to nemo-devel
Hi, and thanks for your suggestions.

I guess this is a personal preference, but I think that the output you propose is not more helpful than the current one (for example, what you propose hides the p). Also, what do you do if p > 10? We also support "q-adic" numbers, that is, unramified extensions of Q_p, where the "digits" would be even more complicated.

Best,
Tommy

PS.: There are three printing modes in Nemo, but I guess you will find them equally unhelpful.

:terse

julia> sqrt(F(2))
5916488742 + O(7^12)

:series

julia> sqrt(F(2))
3 + 1*7^1 + 2*7^2 + 6*7^3 + 1*7^4 + 2*7^5 + 1*7^6 + 2*7^7 + 4*7^8 + 6*7^9 + 6*7^10 + 2*7^11 + O(7^12)

:val_unit

julia> sqrt(F(2))
5916488742 + O(7^12)

### Ed Scheinerman

Aug 11, 2020, 9:33:51 AM8/11/20
to nemo-devel
Yup, it's a personal preference. My code will work for bases greater than 10 using a, b, c, etc for digits. Of course, that'll eventually run out!