Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

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

Search the Archive

Re: Convert Products to Lists

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

In article <3p8ssc$6cr at>, bob at (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
>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 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