Checking if an action is allowed

I have a function that is for removing an element from a list, but if I input a term that is not in the list it gives an error. That isn’t the problem, I am trying to use this function as part of a piecewise expression that runs a different action based on input, and even if the function isn’t the one being cited it still runs an error over the whole action. Is there a way to check for an error, or prevent this?

I think it would be helpful to see the code to understand what’s going on. One thing you can try is making sure the remove function you have always returns a value, even if something like \infinity or an empty list [ ].

my project is at Desmos | Graphing Calculator but is shown better at test | Desmos
I am trying to use E_rase in a piecewise expression, but since it returns an error if the coordinates are not in the list, it doesn’t work

If you are just trying to remove a point from a list, the distance function is probably what you need, and avoids the piecewise. I baked in the ceiling function I noticed as well.

Thank you so much! I couldn’t figure that out.

do you know if there is a way to check if a piecewise expression has an error though? I keep running into that issue.
I want to run an action only when its allowed, but when it isn’t it gives an error, and it won’t let the else run.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.