Karim Belabas on Sun, 08 Nov 2015 18:10:00 +0100


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

Re: real polynomials


* John Cremona [2015-11-06 17:51]:
> For some reason I thought that calling gdiv on two t_INTs would give a
> truncated answer. 

- gdiv() implements the '/' GP operator [ which doesn't truncate ]

- divii() returns the Euclidean quotient of two integers (hence truncates)

> In fact I wanted to make a t_INT out of the
> mantissa and then right-shift it by e places, but the function which
> does that does (I think?) truncate.

Shifting functions come in two variants: 

- gshift() [ truncates, implements the << and >> operators ]

- gmul2n() [ multiplies by 2^n; never truncates, so safe for use when n < 0 ]


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 69 50
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`