MathGroup Archive 2006

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

Search the Archive

Re: Converting an expression to a list of terms?


János wrote:
>>    A + B - C + . . .

The FullForm view of that is:

In[1]:= A + B - C // FullForm

Out[1]//FullForm= Plus[A, B, Times[-1, C]]

So you just want to replace the Plus with List:

In[2]:= List @@ (A + B - C)

Out[2]= {A, B, -C}

-- 
Dr Jon D Harrop, Flying Frog Consultancy
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


  • Prev by Date: Re: General--Trigonometric functions manipulations in Mathematica
  • Next by Date: number not fitting in
  • Previous by thread: Re: Converting an expression to a list of terms?
  • Next by thread: Re: Converting an expression to a list of terms?