Re: simple problem with Map?!?

• To: mathgroup at smc.vnet.net
• Subject: [mg49503] Re: simple problem with Map?!?
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Thu, 22 Jul 2004 02:45:24 -0400 (EDT)
• Organization: Universitaet Leipzig
• References: <cdljfp\$867\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

a/(Plus @@ a) is  a/a for a atom

you mean

pppp = N[#/(Plus @@ #)] &[d0]

Regards
Jens

Relishguy wrote:
>
> I do not understand why the last evaluation ends up screwed:
>
> In[1]:= d0 = {30,60,180,60,30};
>
> In[2]:= tt = Plus @@ d0
> Out[2]= 360
>
> In[3]:=
> Out[3]= {0.0833333,0.166667,0.5,0.166667,0.0833333}
>
> In[4]:= ppp = N[d0 / (Plus @@ d0)]
> Out[4]= {0.0833333,0.166667,0.5,0.166667,0.0833333}
>
> In[5]:= pppp = N[# / (Plus @@ #)]& /@ d0
> Out[5]= {1.,1.,1.,1.,1.}
>
> Can anyone explain this simply? Do I need Hold[] or Evaluate[] somewhere?
>
> TIA.
>
> Regards..

```

• Prev by Date: Re: Applying my function to elements of a vector
• Next by Date: RE: Applying my function to elements of a vector
• Previous by thread: Re: simple problem with Map?!?
• Next by thread: RE: simple problem with Map?!?