From frank.westlake:
I don't think that this problem occurs with -1 so the
problem might not be what I described. I don't have a
Windows computer but I vaguely recall that 16-bit
integers are somehow related to this negative-integer
error. Try experimenting with decimal values at and near
0x8000.
To work around the problem I think I did something like
SET /A "ans=%decimalValue% & 0xFFFFFFFF"
I have a backup of my Windows computer on my Android so
I'll look through my scripts for the solution.
Frank