MathGroup Archive 2005

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

Search the Archive

Re: Re: Confusing results with N[expr]?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62384] Re: [mg62353] Re: Confusing results with N[expr]?
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Wed, 23 Nov 2005 01:12:02 -0500 (EST)
  • References: <dlp320$1bs$1@smc.vnet.net> <200511220941.EAA23606@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 22 Nov 2005, at 18:41, Steven HANCOCK wrote:

> There may be a clue in the following, equally distressing nonsense...

I don't think there is any relation (nor is it, for that matter,   
very distressing).
>
> In[2]:=
> Map[f, a^b]
>
> Out[2]=
>      f[b]
> f[a]
>
> In[3]:=
> f /@ a^b
>
> Out[3]=
>   b
> a
>

This is because f/@ a^b is simply Map[f,a]^b. But


f /@ (a^b)


f[a]^f[b]



> (* MapAll[f, expr] or f //@ expr applies f to every subexpression in
> expr. *)
>
> In[4]:=
> MapAll[f, a^b]
>
> Out[4]=
>        f[b]
> f[f[a]    ]
>
> In[5]:=
> f //@ a^b
>
> Out[5]=
>      b
> f[a]
>
Again:

In[5]:=
f //@ (a^b)

Out[5]=
f[f[a]^f[b]]

Andrzej Kozlowski


>
>>
>>
>


  • Prev by Date: Re: Confusing results with N[expr]?
  • Next by Date: Re: Re: How to View Mathematica and Hardcopy Books
  • Previous by thread: Re: Confusing results with N[expr]?
  • Next by thread: Re: Confusing results with N[expr]?