Ask Your Question

joaofbsm's profile - activity

2024-02-11 06:26:32 +0200 received badge  Famous Question (source)
2020-10-06 10:53:00 +0200 received badge  Notable Question (source)
2020-10-06 10:53:00 +0200 received badge  Popular Question (source)
2017-12-26 22:01:50 +0200 received badge  Student (source)
2017-12-20 09:42:28 +0200 commented answer Defining a protected division operator

Thanks for your answer, Eric. Where do I need to define this function so Sage knows about it when evaluating the operation? Also, I'm running a Python script to simplify an equation, so, will it call this function when simplifying it? This is done by the following lines of code:

eq = "div(x0, x1)"
print(sage_eval(eq, locals=local_vars))
2017-12-19 13:15:15 +0200 asked a question Defining a protected division operator

Is it possible to define a protected division operator in SageMath that turns division by zero into the constant 1? I want to be able to do this when simplifying an expression in Sage. What would be the best approach to it?