8/24/19. Updated question the bottom
I need to find if expression has a "-" in front of it or not. This is for formatting purposes for something I am doing, that is all.
I was using the command sign() for this, and it seems to work OK, but sometimes a Maple error is generated or not leading term sign is returned.
The sign function computes the sign of the leading coefficient of expr.
Is there a better and more robust way to do this other than using sign() or Am I using sign wrong?
Thanks to comment below about using frontend. I never used this before except for now. It seems a very useful command and I think I will be using it a lot more from now on.
Just to clarify again what I want. I am just looking to see if there is a leading negative sign in front of an expression. I am not looking to find if the expression itself can be postive or negative when evaluated or anything more subtle or deep than that.
I simply want to check if there is literally a "-" in front of the maple expression. That is all.
Only issue left, is why Maple still gives Error, invalid argument for sign, lcoeff or tcoeff for the last example below? Here is the updated worksheet.