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 10:42
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Discussion] Script + Algorithm = Rounding, Precise Division Operation (Seeking Essence) DigestI View 17,244 Replies 32
Floor 31 Posted 2009-08-08 03:44 ·  中国 广东 揭阳 电信
初级用户
★★
Credits 131
Posts 72
Joined 2008-02-24 14:31
18-year member
UID 111317
Gender Male
Status Offline
Reply to floor 26

I tested your code with the following numbers and got an error

Dividend: 94677408

Divisor: 704465856

The correct result is 0.134396...

But with your code, the result is calculated as: 0.1-201-20

Another set of numbers

Dividend: 94987952

Divisor: 704465856

Correct result: 0.134836...

With your code, the result is calculated as: 0.1-20020

These two, with 6 decimal places reserved...

Using other codes, the result is the same... I don't know if these two numbers are special or there is a bug in the algorithm?
Floor 32 Posted 2009-11-28 18:03 ·  中国 广东 东莞 联通
银牌会员
★★★
Credits 1,282
Posts 538
Joined 2002-11-02 00:00
23-year member
UID 129
Gender Male
Status Offline
Just looking for software in this area. Unfortunately, it doesn't support pure DOS
Floor 33 Posted 2010-05-30 23:32 ·  中国 天津 电信
新手上路
Credits 8
Posts 33
Joined 2009-11-10 19:45
16-year member
UID 154524
Gender Male
Status Offline
Great! Thanks for sharing...
Forum Jump: