China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-15 00:20
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Get the absolute value through four arithmetic operations in the command line View 4,241 Replies 15
Floor 16 Posted 2007-01-19 01:49 ·  中国 山西 运城 联通
银牌会员
★★★
天的白色影子
Credits 2,343
Posts 636
Joined 2004-03-06 00:00
22-year member
UID 19350
Gender Male
Status Offline
Are you talking about bitwise operations?

Tried it, also works

set /a "b=(a^(a>>31))-(a>>31)"

But bitwise operations are not part of the four arithmetic operations

Therefore, it does not meet the requirements of the original poster
Forum Jump: