Question: Truncation order of "series" function

In Maple 2019.2, I'm trying to compute series expansions. For the input
series(1/z^4/(1-z), z=0, 1);
Maple gives me a series of the expression around z=0, truncated to 1 term, i.e.
z^(-4) + O(z^(-3))

But with the input
series(1/z^4/(1-z), z=0, 2);
Maple gives me the result
z^(-4) + z^(-3) + z^(-2) + z^(-1) + 1 + z + O(z^2)

Apparently Maple has decided not to give a series with 2 terms, but a series up to O(z^2). I'm surprised that the third argument of "series" is not treated in a consistent manner. I've restarted the Maple server between the two computations, so it's not a memory effect.

In the above example, this is just a minor annoyance, but I'm actually dealing with huge expressions, and for performance reasons it's important to truncate the series expansion at the desired order and stop further computations. Has anyone encountered this problem?

Please Wait...