| Karim Belabas on Tue, 30 Jul 2019 00:36:56 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: real/imag for t_QUAD |
* 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.
Cheers,
K.B.
--
Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux Fax: (+33) (0)5 40 00 21 23
351, cours de la Liberation http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France) http://pari.math.u-bordeaux.fr/ [PARI/GP]
`