Using the Square root function in cl

This code does not give me the square root. I must be doing something silly. It is giving a number that is clearly not correct.


Here is a link to the slide.

I just want to create code that checks if num is a perfect square, using the round function and the square root function, but I can’t get past this part of it.

What you have is super close to working! It’s just a bit of syntax:

# This will not work as expected
c = numericValue("\sqrt${num}")

# This will work as expected
c = numericValue("\sqrt{${num}}")

thank you. I will never get that hour back that I spent trying to figure it out. It makes sense too. Need the ${} insdide the { } …perfect!

For future reference, the easiest thing to do is type the function the way you want to see it in a regular desmos calculator or input box, then copy it. When you paste it into CL it will be in correctly formatted latex. Then you can replace numbers with ${variables} in the latex string.

Here is the slide. I know it is a bit spartan at this time. It makes a random binomial ax^2-b from a list of numbers, most of which are perfect squares, and the students just need to say yes a diff of squares, no not a difference of squares.
It was kind of fun to make, even though it is pretty narrow in focus. As I said, most of the time spent was trying to get that sqrt function to work!!

The slide can be copied to create as many problems as needed. (I used a table at the end to give feedback in the final product)

A good thing to know is that you can use a hidden graph component to do calculations, and pull values into a note with CL. It’s often easier to do complex calculations with lists and randomizations and stuff in the calculator than directly in CL, since the available tools are more robust. Here is an example of how you can make a perfect square maker using those techniques. [Copy of] Random diff of square maker • Activity Builder by Desmos

Excuse me, i want to know how to type cos in CL, is it right?
h = numericValue(“\cos{${variable}}”)