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-06-25 06:55
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to perform decimal point operations under CMD in WINDOWS? View 1,746 Replies 7
Original Poster Posted 2007-05-17 17:13 ·  中国 广东 广州 电信
中级用户
★★
Credits 201
Posts 72
Joined 2005-11-20 20:57
20-year member
UID 45624
Status Offline
Integer operations are okay, but decimal point operations are not. For example:
set /a BB=9*0.6 displays 0, and methods like set /a BB=9*(0.6) don't work either.
I searched the forum and didn't find related issues. Please give your advice!
Floor 2 Posted 2007-05-17 17:23 ·  中国 浙江 杭州 联通
银牌会员
★★★
Credits 1,928
Posts 931
Joined 2007-01-06 11:46
19-year member
UID 75624
Gender Male
Status Offline
Floor 3 Posted 2007-05-17 17:25 ·  中国 重庆 沙坪坝区 电信
中级用户
★★
金牌会员
Credits 315
Posts 152
Joined 2007-01-25 23:55
19-year member
UID 77669
Gender Male
Status Offline
The computing power of CMD is indeed relatively weak: it does not directly support the addition, subtraction, multiplication and division of decimals.
Floor 4 Posted 2007-05-17 17:36 ·  中国 广东 广州 电信
中级用户
★★
Credits 201
Posts 72
Joined 2005-11-20 20:57
20-year member
UID 45624
Status Offline
So, is there a way to implement decimal multiplication operations through the VBS script method?
Floor 5 Posted 2007-05-17 17:37 ·  中国 重庆 沙坪坝区 电信
中级用户
★★
金牌会员
Credits 315
Posts 152
Joined 2007-01-25 23:55
19-year member
UID 77669
Gender Male
Status Offline
The answer is given on the 2nd floor.
Floor 6 Posted 2007-05-17 19:05 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
If it's VBS, it's too simple. It's just that the output format has some problems when the number of digits is too long. I don't know how to get rid of that scientific notation.
你好,脚本专家!
<a target=blank href=tencent://message/?uin=29654761&Site=www.111.com&Menu=yes><img border="0" SRC=http://wpa.qq.com/pa?p=1:29654761:5 alt="点击这里给我发消息"></a>
Floor 7 Posted 2007-05-17 19:12 ·  中国 陕西 西安 电信
铂金会员
★★★★
Credits 5,212
Posts 2,478
Joined 2007-02-08 23:39
19-year member
UID 79003
Gender Male
Status Offline
Simulating manual operations can solve... multiplication, addition, and subtraction of large numbers... I still don't know how to write division.
Floor 8 Posted 2007-05-17 19:14 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
http://www.cn-dos.net/forum/viewthread.php?tid=29097&fpage=1&highlight=%E5%9B%9B%E8%88%8D%E4%BA%94%E5%85%A5
There are also several challenge threads involving division of large numbers.
Forum Jump: