Check a table value with a sqrt

I want to check table inputs for correctness but I don’t know how to enter a sqrt into cl.

I want the correct answer to be sqrt(5)/13

here is the code I was trying to update

correct: a=sqrt(5)/13 and b=0.8 and c=0.75
a = table1.cellNumericValue(1,2)
b = table1.cellNumericValue(2,2)
c = table1.cellNumericValue(3,2)

That requires a calculation, which can be done in CL using either numericValue( ) or simpleFunction( ).evaluateAt( ). If you use numericValue, you’ll want to round it (and the student input):

correct: a=numericValue(`\round(\sqrt{5}/13,2)`)...
a = numericValue(`\round(${table1.cellNumericValue(1,2)},2)`)

Using the latter can generally make better comparisons without rounding, but looks like a bit much:

correct: a=simpleFunction(`\sqrt{5}/13`).evaluateAt(0)...
a = simpleFunction(`${table1.cellNumericValue(1,2)}`).evaluateAt(0)
1 Like

Worked. Thanks. Burton