# Rational Function Correctness

Hi all,

Wondering if I can get some insight on why correctness works on the second slide and not on the first? Here is the activity. Rational Function CL Question • Activity Builder by Desmos

Not sure why but if you actually list on the screen for those evaluateAt you get infinity. https://teacher.desmos.com/activitybuilder/custom/605b86fc8cd6f23469958d3d

The reason is that the evaluateAt is in fact defined (as NaN).
You could change the first slide to read (all one line):
correct = isUndefined(numericValue(`\${studentfunction.evaluateAt(4)}`)) and isUndefined(numericValue(`\${studentfunction.evaluateAt(-4)}`))
which will work. Note: the backticks (before the \$ sign and after the closing } in both instances are not rendered in html.

I had no idea that evaluateAt was not a number. That is strange. Thank you.

You might also consider just checking if the reciprocal evaluates to 0. Might need to parse the right hand side, or just send the function to the graph.

evaluateAt does output a number. the numericValue with the interpolation is extraneous here and may actually be counterproductive.

numericValue takes a string and finds the numeric value of that string. With the added interpolation, its taking the “evaluateAt” value (a numeric value), representing it as a string (the interpolation), and then finding the numeric value of that string. At best it does exactly what isUndefined(…evaluateAt(n)) does. In some rare cases - most notably really small or large values, the numeric value gets printed as #.###e+## which is then computed to be the decimal times the constant “e” plus the place value: 