:toDec | convert a hexadecimal number to decimal |
:toHex | convert a decimal number to hexadecimal, i.e. -20 to FFFFFFEC or 26 to 0000001A |
DOS - Arithmetic | How to use SET /A for arithmetic in DOS |
Floating Point Arithmetic | Working around the limitations of the command processor. |
Large Integers | Working around the limitations of the command processor. |
Percent | Basic Percent arithmetic. |
SET /A | Basic Integer Arithmetic. |
Description: | call:toDec hex dec | ||
Script: |
|
Description: | call:toHex dec hex | ||
Script: |
|
Description: | Floating point arithmetic can be achieved by moving the fractions into the integer. I.e. A floating point equitation using values with 3 digits after the dot can be calculated as follows:
Floating Point: 12.055 + 1.001 = 13.056 Integer: 12055 + 1001 = 13056 |
||
Script: |
|
||
Script Output: |
|
Description: | The SET /A command can be used for basic arithmetic.
You can write SET /a y=3*x or SET /a y=3*%x%. Both are correct. The command interpreter is smart enough to recognize variables within a formula. |
||
Script: |
|
||
Script Output: |
|