MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Reverse order terms and 0-origin array.

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1635] Re: [mg1601] Reverse order terms and 0-origin array.
  • From: Richard Mercer <richard at seuss.math.wright.edu>
  • Date: Sat, 8 Jul 1995 02:45:25 -0400

>  1) When I type Expand[(x+1)^2], Mathematica returns 1 +
>  2x + x^2.  Can receive the result in the reverse order,
>  i.e., x^2 + 2x + 1 ?

Although I have made Mathematica jump through many hoops in 5 years of  
programming, the most frustrating failure has been my inability to provide the  
option to have polynomials print out in traditional order. I know in principle  
how it apparently could be done, but as I have not yet been able to make it  
work there is no point in providing any details.

The default sorting in Mathematica is difficult to turn off without side  
effects because it is so closely linked with the aggressive evaluation scheme.  
Oh sure you can try
Unprotect[Plus]
ClearAttributes[Plus,Orderless]
but that is begging for trouble and I promise you many undesirable side  
effects.

I have tried to establish a custom format for printing polynomials, but  
whenever I sort the polynomial my way, somehow Mathematica always manages to  
resort it in the default order before it appears as output. Very frustrating,  
even by Mathematica standards! I haven't given up and someday will take another  
crack at it.

Richard Mercer



  • Prev by Date: How do I find my current directory?
  • Next by Date: Re: Q: Random[]
  • Previous by thread: Reverse order terms and 0-origin array.
  • Next by thread: Re: Reverse order terms and 0-origin array.