![]() |
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-10-24 09:02 |
47,815 topics / 349,928 posts / today 0 new / 48,287 members |
| DOS批处理 & 脚本技术(批处理室) » [Joint Participation] [Challenge Ideas] [Batch Processing Floating-Point Operations] |
| Printable Version 47,108 / 136 |
| Floor106 vkill | Posted 2006-10-20 05:39 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
C:\>set/a a=999999999999999999999/8
Invalid number. Numeric precision limited to 32 bits. I'm wondering, adding 41 zeros to the tail of the dividend means even more digits, right? It can still calculate? Why? |
|
| Floor107 不得不爱 | Posted 2006-10-20 07:10 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
Adding 41 zeros to the tail of the dividend is for outputting decimals. My script can handle dividends with thousands of digits. If you don't believe it, try it yourself
|
|
| Floor108 pengfei | Posted 2006-10-21 00:43 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
I looked over moderator qwe1234567's code on the 102nd floor. It's written very well. It absorbed the best ideas from earlier posts, and changed brother he200377's repeated-calculation plan of adding zeros at the end to improve precision into dividing the divisor down to 9 digits and then taking it out one digit at a time for calculation. Because of that, it broke through the digit limit on the dividend. It also considers some details more thoroughly, such as carrying around the decimal point, etc. This is the crystallization of collective wisdom.
To break through the digit limit of the divisor, a more divergent line of thinking is needed. And I still haven't had the courage to implement that algorithm I fear so much. Maybe I really am a bit scared, scared that its efficiency will give you all a shock... [ Last edited by pengfei on 2006-10-21 at 00:45 ] |
|
| Floor109 不得不爱 | Posted 2006-10-21 02:29 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
To break through the digit limit of the divisor, you first need to come up with an approach
|
|
| Floor110 vkill | Posted 2006-10-21 22:51 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
As for breaking through the divisor digit limit, I don't think there's any good method. I really can't think of one anymore
|
|
| Floor111 不得不爱 | Posted 2006-10-21 23:01 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
I actually can break through the divisor digit limit, the method is still being worked out
|
|
| Floor112 vkill | Posted 2006-10-21 23:09 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
Originally posted by qwe1234567 at 2006-10-21 23:01: Talk about the basic idea~ everyone can think about the method together, haha~ |
|
| Floor113 redtek | Posted 2006-10-21 23:13 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Using a simulated array method?
Say it already~~~ :))) |
|
| Floor114 不得不爱 | Posted 2006-10-21 23:20 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
Just divide first, then multiply, then subtract
|
|
| Floor115 vkill | Posted 2006-10-21 23:23 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
Originally posted by qwe1234567 at 2006-10-21 23:20: Still don't understand~ |
|
| Floor116 不得不爱 | Posted 2006-10-22 07:07 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
Wait until I post it, then you'll understand
|
|
| Floor117 pengfei | Posted 2006-10-22 08:34 |
| 银牌会员 Posts 485 Credits 1,218 From 湖南.娄底 | |
|
OK, I'll look at your work. My algorithm does break through the digit limit, but the efficiency is too low.
|
|
| Floor118 不得不爱 | Posted 2006-10-23 00:02 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
After several days of continuous testing and code optimization, I finally made a script that can perform division on N-digit real numbers. But the divisor had better stay within 16 digits, otherwise the waiting time gets too long; the more digits the divisor has, the longer the wait! Please test it....
Sigh, CMD's calculation speed is too slow.... |
|
| Floor119 不得不爱 | Posted 2006-10-23 00:03 |
| 超级版主 Posts 2,044 Credits 5,310 From 四川南充 | |
|
This script is 4K long.
|
|
| Floor120 vkill | Posted 2006-10-23 03:50 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
Moderator qwe1234567, this one is much better written, haha, and it even has explanations, so it's not tiring to read~ bump
|
|
| Prev 1 … 5 6 7 8 9 10 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |