Vincent Delecroix on Tue, 30 Jul 2019 00:28:55 +0200


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

Re: real/imag for t_QUAD


Le 30/07/2019 à 00:25, Bill Allombert a écrit :
On Tue, Jul 30, 2019 at 12:14:17AM +0200, Vincent Delecroix wrote:
Thanks Karim and Bill for your replies! I did not look further than
the simple '?real' and '?imag'.

Now, the real question: how can I convert a t_QUAD to a t_COMPLEX (in
the usual sense) with the pari library? greal/real_i and gimag/imag_i
have the same behavior as in GP.

Multiply by '1.'.

? quadgen(-23)*1.
%1 =
0.50000000000000000000000000000000000000+2.3979157616563597707987190320813469600*I

But the real question is why do you want to use t_QUAD ?

I don't want to use it. I am working on cypari2. I want to fix the
conversion of GEN to Python complex number (double floating point
precision). This used to rely on real_i/imag_i and the question is
how should I deal with t_QUAD properly?

Vincent