MathGroup Archive 2007

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

Search the Archive

Re: Polynomial as a List

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77284] Re: Polynomial as a List
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Wed, 6 Jun 2007 07:13:54 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f43ghr$2db$1@smc.vnet.net>

Nick wrote:
> I have a polynomial,
> Lets say:
> 
> 1 + x + x^2 + x^3 + x^4
> 
> 
> and all I need to do is get that into a list of this form
> 
> {x^4, x^3, x^2, x, 1}
> 
> 
> Can anyone help me figure this out?
> 
> Thanks so much!

poly = 1 + x + x^2 + x^3 + x^4;
Reverse[List @@ poly]

{x^4, x^3, x^2, x, 1}

Regards,
Jean-Marc


  • Prev by Date: Re: Mapping a pure function with 2 conponents.
  • Next by Date: Re: Clear variables
  • Previous by thread: Re: Polynomial as a List
  • Next by thread: Re: Polynomial as a List