Condition to show not working with decimals.

adryer shared this question 7 months ago
Answered

I am trying to get a script that allows the user to input the y intercept and the slope of a regression equation to check and see if it is correct.

So far I have the input and I thought I had the show condition correct but it only works if the answer is a whole number. If there are decimals involved it does not seem to show it as being correct.

Can anyone assist with this, thank you!

https://www.geogebra.org/m/aw2zppuh

Best Answer
photo

Instead of a==b maybe try with a tolerance eg abs(a-b)<0.00001

Comments (5)

photo
1

Instead of a==b maybe try with a tolerance eg abs(a-b)<0.00001

photo
1

That worked! Thank you very much I didn't think of that. The one thing it doesn't display for is if there is no entry, I tried using a blank space but it doesn't seem to go through. If it doesn't work that's fine now that I have this, but do you have any thoughts?

photo
1

Sorry, not sure what you mean. Please post the link and say what to do

photo
1

Michael,

On the same link (https://www.geogebra.org/m/aw2zppuh) I updated it so that the answers will now show correct or incorrect. However, if left blank, it does not show that it is correct or incorrect.

I am trying to have it so that it shows the answer is incorrect if there is no input entered (left blank).

photo
1

Use the IsDefined command on the condition to show the Correct / Incorrect text.

https://wiki.geogebra.org/e...

photo
© 2020 International GeoGebra Institute