batch 数字进制的问题

when set viable to number type in cmd
example: set /a num=0833
echo %num%

display:
Invalid number.  Numeric constants are either decimal (17),
hexadecimal (0x11), or octal (021).

reason:
when the number has prefix with 0, it is octal,  08 and 09 are invalid number.
when the number has prefix with 0x, it is hexadecimal

0x12 = 18 = 22

原文地址:https://www.cnblogs.com/qianlixing/p/5160558.html