[sage-support] Re: Error: Converting from p-adics to rationals.

2011-06-16 Thread Mel
I do want to convert to an integer in this particular case...but integers are rationals, so I don't understand why I don't just get the integer 344 when I try the following code: sage: K=Qp(7,5) sage: Q=QQ sage: a=344 sage: b=K(a) sage: a=Q(b) -- To post to this group, send email to

[sage-support] Re: Error: Converting from p-adics to rationals.

2011-06-16 Thread Mel
Here is the code that can be pasted into sage to produce the error: sage: K=Qp(7,5) sage: Q=QQ sage: a=344 sage: b=K(a) sage: a=Q(b) -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For

[sage-support] Re: Error: Converting from p-adics to rationals.

2011-06-16 Thread Nils Bruin
On Jun 16, 7:22 am, Mel chemmyg...@gmail.com wrote: I do want to convert to an integer in this particular case...but integers are rationals, so I don't understand why I don't just get the integer 344 when I try the following code: If you are sure that the element can be represented as an

[sage-support] Re: Error: Converting from p-adics to rationals.

2011-06-16 Thread JamesHDavenport
As I said previously, you are only going to reconstruct RATIONALs with num,den less than sqrt((1/2)*p^k), i.e. 92 in this case. It is true that the integers are a subset of the rationals, but the convert to integer problem is not a sub-problem of the convert to rational problem. On Jun 16, 3:22 

[sage-support] Re: Error: Converting from p-adics to rationals.

2011-05-27 Thread JamesHDavenport
I know very little about SAGE, but surely the point is that this is not well-defined: what rational were you expecting? You can only guarantee to get a number with (num,den) sqrt(p^k/2), and there isn't one, as 1 itself doesn't work. Did you wnat to convert to integer? On May 26, 1:53 am, Mel