Why different result for table calculation?

This is courtesy of @chrisleechss. Both columns of the table below are supposed to calculate the square root of the number that students input in the first column…

Why does the script in the middle column produce nonsense for x>10? Is this a bug?

P.s. In fact, the script in the middle column only works with integers from 0 to 9. Nothing else gives a correct answer.

Solution was found in the other thread I believe, so as in the other thread, this format is needed:

\sqrt{ ${table.cellContent(1,1) }

or a function as @Jay gave.

Note, in the original code, the error occurs when you increase to two digits, so you also have errors inputting decimal values. It’s essentially evaluating \sqrt{first digit}*remaining digits.

1 Like

Thank you for the explanation. Much appreciated.