Message Boards Message Boards

0
|
3749 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[?] Get Polynomial printout of -x +1 as -x +1 and not 1- x?

Posted 7 years ago

Is there any way to have as polynomial output for polynomials in one variable always ordered polynomials from larger exponents to the constant as last part. I know TraditionalForm but it gives not the desired result for e.g. -x+1. This gives always the output as 1-x.

2 Replies

Thanks for the hint, Gianluca. I changed the wonderful

nicePolynomial[poly_,x_]

to

nicePolynomial[poly_Plus, x_]

and added as second definition

nicePolynomial[poly_, x _] := poly

and now a single monomial is displayed perfect also.

Something similar was discussed a few month ago in the thread: "Get polynomials in TraditionalForm to be ordered in descending order?"

http://community.wolfram.com/groups/-/m/t/1152222

You may adapt those techniques for your problem.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract