I was making a code to find square roots for practice with basic cmd coding. However, when I type in a negative number, or an imperfect square, then it goes in an infinite loop. I know how to fix it, but I need to be able to use inequalities( Less than, greater than). (x is the number I have, and y is it's square root) That way I can say:
- if %x% (is less than) 0 (Don't operate)
- if %y% (is greater than) %x% (Don't operate)
or I could create another variable that is everything less(z)/greater(n) than x:
- if %x% == %z% (Don't operate)
- if %x% == %n% (Don't operate)
Please help me. I can't seem to find an answer.