I am doing computations with Julia polynomials of rationals. After an operation I might have a polynomial of high degree, I want to truncate to a polynomial of a smaller degree by throwing out the higher order terms. I figured out a solution below. But the code is going to run for hours and I need to make things as optimized as possible. I basically re-created a new Poly. Is there a better way?
using Polynomials
R = Polynomial{Rational{BigInt}, :x}([1,2,2,2])
L = coeffs(R)
R = Polynomial{Rational{BigInt}, :x}(L[1:2])