Infinity when division by zero - Shouldnt it still be "udefined"

This was brought up before, but I just wanted to show it in a real simple example. How is this possibly considered “defined” ? It really messes up some of my cL error checking code.

f=simpleFunction(\frac{x}{x-3})
x=3
fx1=f.evaluateAt(x)
message=when isUndefined(fx1) “Not Defined”
otherwise “Is Defined”

The message comes out to “Is Defined”. I always assumed division by zero was “undefined”
What is the simplest work around? The function will not always be a rational function in my project, so parsing the function would be a silly amount of extra work.

If it is giving the answer as infinity, I should be able to add this condtional:
when fx1>999999999999999999999999 “Divison by 0”.
(just kidding).

You can adapt your function like this graph. If you need to have it more generalized in your CL:

funcLatex=`\frac{x}{x-3}`
f=simpleFunction(`\left\{\left|${funcLatex}\right|<\infty:${funcLatex}\right\}`)

My work around was to put the function value into the table, and then if the tableCell value was “Infinity” , then the error message would be given.

The slide is a “template” for finding derivatives. Pretty much any function can be put into the table, and then then derivative is checked at two inputs. I wanted to add code that would give me a heads up if there is a domain issue with the “test” values.

Agree it’s pretty… well let’s stay “silly” instead of other word I was thinking of.

The simplest solution to this is to use numericValue for checking. Like this:

fx1=numericValue("${f.evaluateAt(x)}")

The documentation itself is incorrect in this regard. It says that:

“isDefined takes any type and returns a boolean for if it’s defined. For example, use with the numericValue of an expression”

I believe it only truly works in these cases using numericValue and no other kind of check.

Here’s a rejig of your sample code to show it now works: [Copy of] Infinity vs undefined • Activity Builder by Desmos

Thanks. That’s pretty good. Similar idea to what I did with the table, but skipping the putting the value in the table step.