MathGroup Archive 2006

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

Search the Archive

Re: Converting an expression to a list of terms?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg71480] Re: [mg71463] Converting an expression to a list of terms?
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Mon, 20 Nov 2006 06:17:14 -0500 (EST)
  • References: <200611200743.CAA09240@smc.vnet.net>

On 20 Nov 2006, at 16:43, AES wrote:

> How to convert an expression consisting of a sum of terms in an Output
> cell:
>
>    A + B - C + . . .
>
> (where A, B, C are themselves product expressions) to a list
>
>    {A, B, -C, . . . }
>
> in some easier fashion than doing it by hand using Find and Replace?
>

Simply Apply-ing List to the expression will do it, e.g.


List@@(a+b-c-d)


{a,b,-c,-d}

Andrzej Kozlowski
Tokyo, Japan


  • Prev by Date: Re: Why does this lead to an answer with complex numbers?
  • Next by Date: Re: Converting an expression to a list of terms?
  • Previous by thread: Converting an expression to a list of terms?
  • Next by thread: Re: Converting an expression to a list of terms?