MathGroup Archive 2000

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

Search the Archive

Re: selfdefined operators

"Roland Koppenberger" <roland at> wrote in message
news:8cp5rj$csm at
> I have defined the operator \[CirclePlus] in the following way:
> x_ \[CirclePlus] y_ := x y /(x + y)
> When type in
> 1 \[CirclePlus] 2
> I get 2/3 as the right result. But when I try to compute
> 1 \[CirclePlus] 2 \[CirclePlus] 3
> the result will not be computed. How can I specify the operator in a
> general way?


First, we get

        CirclePlus[x, y]

(in other words, Mathematica changes our input into this form before evaluation)

Noting this, we take your definition

x_ \[CirclePlus] y_ := x y /(x + y)

and add

CirclePlus[x_, y_, z__] := CirclePlus[x, CirclePlus[y, z]]

Now we get


        (x*y*z)/((y + z)*(x + (y*z)/(y + z)))

You may want the association to be on the other side.

Allan Hayes
Mathematica Training and Consulting
Leicester UK
hay at
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

  • Prev by Date: Re: Mod Bessel function bug ?
  • Next by Date: Re: selfdefined operators
  • Previous by thread: RE: selfdefined operators
  • Next by thread: M4 Problems with Initialization Cells