RosettaCodeData/Task/Exponentiation-operator/Mathematica/exponentiation-operator-1.math

3 lines
147 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
exponentiation[x_,y_Integer]:=Which[y>0,Times@@ConstantArray[x,y],y==0,1,y<0,1/exponentiation[x,-y]]
CirclePlus[x_,y_Integer]:=exponentiation[x,y]