MathGroup Archive 1995

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

Search the Archive

Re: Convert Products to Lists

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1147] Re: Convert Products to Lists
  • From: hibbarda at central.edu (Al Hibbard)
  • Date: Wed, 17 May 1995 05:19:25 -0400
  • Organization: Central College, Iowa

In article <3p8ssc$6cr at news0.cybernetics.net>, bob at zim.uoregon.edu (Robert Zimmerman) writes:
>Is it possible to convert a product of numbers to a list of numbers.  
>It can be done for symbols, 
>
>
>a b c //.Times->List
>{a, b, c}
>
>but it doesn't work for numbers
>
>2  4  6//.Times->List
>48
>
>Can it be done?

The problem is with evaluation of the product before the replacement
takes place.

One solution is as follows:

(2 4 6//HoldForm)/.Times->List//ReleaseHold

{2, 4, 6}

Al Hibbard


--------------------------------------------------------------
| Al Hibbard              Mathematics/Computer Science Dept. |
| hibbarda at central.edu    Central College                    |
| (515) 628-5133          Pella, IA 50219  USA               |
--------------------------------------------------------------



  • Prev by Date: Sort[] accuracy problem
  • Next by Date: Graphics Blank Margin
  • Previous by thread: Re: Convert Products to Lists
  • Next by thread: Convert Products to Lists