Re: Bug in CMD.exe? Parentheses confused



Thanks.

Also you the numbers in set statement arithmetic must be interger, not
decimal fractions.

This works:
set /a sum=2+2

This doesn't:
set /a sum=2.1+2.2

- Rich

Eman wrote:

It's not out of place to escape all suspect
on the right of the "set something=" statement.
E.g., this would work:

~~
@echo off
if 1==1 (
set /a result = 2*^(3+4^)
)
echo result=%result%
~~

And this one too:

~~
@echo off
if 1==1 (
set /a result =^ ^2^*^(^3^+^4^)
)
echo result=%result%
~~

.


Loading