# How can I redefine multiplication?

For instance, I want 0 Infinity = 0

I tried this: Unprotect[Times];Times[Infinity,0]=0;Times[0,Infinity]=0;Protect[Times];

But this did not work.

• To reiterate the warning already given: modifying basic arithmetic functions will very likely break so many things in unexpected ways. Jun 30 at 13:50

Please do not do this. You'll break everything. Better to define your own operator and use that.

But if you must, this works by defining upValue of Times

Unprotect[Times];
Unprotect[DirectedInfinity];
Unprotect[Integer];
Times[Infinity, 0] ^:= 0
Protect[Integer];
Protect[DirectedInfinity];
Protect[Times];


• What does ^:= do? Jun 30 at 13:04
• @Anixx ^:= defines UpValue of function. See TransformationRulesAndDefinitions Jun 30 at 13:05