[Date Index] [Thread Index] [Author Index]
Re: Re: Confusing results with N[expr]?
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:= > Map[f, a^b] > > Out= > f[b] > f[a] > > In:= > f /@ a^b > > Out= > 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:= > MapAll[f, a^b] > > Out= > f[b] > f[f[a] ] > > In:= > f //@ a^b > > Out= > b > f[a] > Again: In:= f //@ (a^b) Out= f[f[a]^f[b]] Andrzej Kozlowski > >> >> >