Yes, two Integer variables can indeed be used in Comparisons, so long as they are expanded. Quoting integers for the sake of comparisons is one means to safeguard against invalid variables, another is to make use of Delayed Expansion (Enabled)
There's a great explanation of integer comparison syntax issues here
The below MathCro can be used to assign and modify variables if your interested. In the event an attempt to operate on the 1st Argument with an undeclared variable is made, No change to the variable will occur.
@Echo Off
%= Establish Macros =%
setlocal DisableDelayedExpansion
(set LF=^
%= Newline =%)
Set ^"\n=^^^%LF%%LF%^%LF%%LF%^^"
(Set "Operate=Endlocal ^& Set /A ""%%G%%H=%%I"""
%= 'Tunnels' variable value, Allows Definition of Arithmetic within Macro =%)
Set @M=for /L %%n in (1 1 2) do if %%n==2 (%\n%
for /F "tokens=1,2,3 delims=, " %%G in ("!argv!") do (%\n%
%Operate%%\n%
%= Display value of variable. Optional. If not syntax is required to constrain expansion =%
If Not "!%%G!"=="" Echo(%%G: !%%G!%\n%
) %\n%
) ELSE setlocal enableDelayedExpansion ^& set argv=,
%= script main body =%
%= Facilitate modification of variables within codeblocks. =%
Setlocal EnableDelayedExpansion
REM macro can be used to define as well as modify variables
REM output of macro can be redirected to nul (hidden) like so:
REM (%@M% hp + 50)>nul
%@M% hp + 50
(%@M% heal + 40)>nul
%@M% hp - 30
%@M% hp + 25
%@M% hp * 3
%@M% hp / 2
%@M% hp + heal
%@M% heal - 10
%@M% hp + heal
%= Demonstrates use of an equation beyond the initial Operator. Spaces and parentheses in equation must be ommited =%
%= Increments variable by a random amount in the range of 10 to 20 =%
For /L %%A in (1,1,50) do (%@M% hp + !random!%%10+10)>nul
Echo(hp: %hp%
For /L %%A in (1,1,50) do IF Not !hp! LSS !heal! (%@M% hp - !random!%%15+10)
pause >nul
Exit /B