3
$\begingroup$

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.

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

1 Answer 1

5
$\begingroup$

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];

Mathematica graphics

$\endgroup$
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.