I'm a bit of a batch file noob (but an aspiring enthusiast!) so please excuse me if my answer isn't helpful lol.
By typing if /?
at the command line you'll see these comparison operators:
EQU - equal NEQ - not equal LSS - less than LEQ - less than or equal GTR - greater than GEQ - greater than or equal
In this case I would use this syntax:
if result LSS 0 (goto :error) else (goto :done)
I hope this helps!