13 Jun
2023
13 Jun
'23
5:55 p.m.
Hi, all. I'm trying to expand expressions into series, and I've run into a case which looks broken (with the latest GiNaC): ginsh> series((x+x^2)^2,x,0); (Order(1)^2)*x^(-2)+Order(1) What I expect is Order(1) here, because the expression starts at O(x^2). Same problem with e.g. (x+sin(x))^2, and lots of other expressions. It seems that any non-trivial expression that starts at O(x) or higher to a power expands into this sort of an unhelpful result. Note that trying to remove the Order() parts does not work: ginsh> series_to_poly(series((x+x^2)^2,x,0)); x^(-2)*Order(1)^2 What I expect here is "0" instead. Any ideas on what's going on and how to fix it?