中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-10 16:59
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How to perform decimal point operations under CMD in WINDOWS?
Printable Version  1,816 / 7
Floor1 cain Posted 2007-05-17 17:13
中级用户 Posts 72 Credits 201
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!
Floor2 wudixin96 Posted 2007-05-17 17:23
银牌会员 Posts 931 Credits 1,928
Floor3 fengzi Posted 2007-05-17 17:25
中级用户 Posts 152 Credits 315
The computing power of CMD is indeed relatively weak: it does not directly support the addition, subtraction, multiplication and division of decimals.
Floor4 cain Posted 2007-05-17 17:36
中级用户 Posts 72 Credits 201
So, is there a way to implement decimal multiplication operations through the VBS script method?
Floor5 fengzi Posted 2007-05-17 17:37
中级用户 Posts 152 Credits 315
The answer is given on the 2nd floor.
Floor6 zhoushijay Posted 2007-05-17 19:05
高级用户 Posts 375 Credits 845
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.
Floor7 slore Posted 2007-05-17 19:12
铂金会员 Posts 2,478 Credits 5,212
Simulating manual operations can solve... multiplication, addition, and subtraction of large numbers... I still don't know how to write division.
Floor8 bjsh Posted 2007-05-17 19:14
银牌会员 Posts 621 Credits 2,000
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.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023