Vincent Delecroix on Tue, 30 Jul 2019 01:06:32 +0200


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

Re: real/imag for t_QUAD


Le 30/07/2019 à 00:36, Karim Belabas a écrit :
* Karim Belabas [2019-07-30 00:35]:
* Vincent Delecroix [2019-07-30 00:28]:
Le 30/07/2019 à 00:25, Bill Allombert a écrit :
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?

  x = quadtofp(x, DEFAULTPREC);

and then you have an ordinary complex number (possibly real or even rational)
to worry about.

More generally, gtofp() is the standard libpari idiom to replace GP's x * 1.

Merveilleux!

Thank you.
Vincent