Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

WAD More SET /A woes

May
12,834
163
v24:
[/code]
v:\> set /a zz=10/7
1

v:\> echo %zz
1[/code]

v20:
[/code]
g:\tc20> set /a zz=10/7
1.4285714286

g:\tc20> echo %zz
1.4285714286[/code]
 
Aha CMD! It's a shame. It worked better from (at least) v8 up to v20.
 
I cannot think of any reason to use the tortured SET /A syntax if you're *not* using CMD.

It saves a lot of typing (which I'm not good at) especially when the expression that must be repeated on the right side is complicated.
Code:
set /a a[%i,%j]+=%t
set a[%i,%j]=%@eval[%a[%i,%j]+%t]

@EVAL is faster though ... and (now) more capable.
 

Similar threads

Back
Top