Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Unevaluated a[[1]]*a[[2]]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65180] Re: [mg65165] Unevaluated a[[1]]*a[[2]]
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 16 Mar 2006 06:33:40 -0500 (EST)
  • Reply-to: hanlonr at cox.net
  • Sender: owner-wri-mathgroup at wolfram.com

unevalTimes[x_List]:=
    Module[{s=ToString/@x},
      Fold[#1<>" * "<>#2&,First[s],Rest[s]]];

a={0.1245,0.543};

x=unevalTimes[a]

0.1245 * 0.543

ToExpression[x]==Times@@a

True

x=unevalTimes[Range[7]]

1 * 2 * 3 * 4 * 5 * 6 * 7

ToExpression[x]==7!

True


Bob Hanlon

> 
> From: "Alexandre Costa" <amscosta at uem.br>
To: mathgroup at smc.vnet.net
> Subject: [mg65180] [mg65165] Unevaluated a[[1]]*a[[2]]
> 
> Dear Group,
> Suppose I have  a = {0.1245, 0.543};
> I want to check the values of the product:
> a[[1]]*a[[2]]. So I just want to see the product unevaluated as output: 
> 0.1245*0.543.
> Thanks,
> Alex
> 
> 
> 


  • Prev by Date: Different font behavior between kernel and front-end
  • Next by Date: Re: getting one random number
  • Previous by thread: Re: Unevaluated a[[1]]*a[[2]]
  • Next by thread: How to get rid of If[ ... ] in a result