数学中国

 找回密码
 注册
搜索
热搜: 活动 交友 discuz
楼主: ysr

[原创]大整数的乘法

[复制链接]
 楼主| 发表于 2014-3-17 21:10 | 显示全部楼层

[原创]大整数的乘法

http://zhidao.baidu.com/question/312875741.html
 楼主| 发表于 2014-3-17 21:15 | 显示全部楼层

[原创]大整数的乘法

http://bbs.csdn.net/topics/20116509
 楼主| 发表于 2014-3-23 13:04 | 显示全部楼层

[原创]大整数的乘法

网友用VB编的超大精度科学计算器代码:
http://www.docin.com/p-208787011.html
 楼主| 发表于 2014-5-1 17:52 | 显示全部楼层

[原创]大整数的乘法

文件的加密和解密:
http://hi.baidu.com/100bd/item/dfc360157f07dafd9c778a6f
 楼主| 发表于 2014-5-11 09:44 | 显示全部楼层

[原创]大整数的乘法

字符转换:
http://study.qqcf.com/web/166/18714.htm
 楼主| 发表于 2014-6-3 09:42 | 显示全部楼层
73257426341980265837263108290320745693771572143175
我搞出1个加密软件,以上为密文,感兴趣的可以破解试验!
 楼主| 发表于 2017-5-20 18:27 | 显示全部楼层
顶一下,欢迎试用
 楼主| 发表于 2021-3-25 11:38 | 显示全部楼层
本帖最后由 ysr 于 2021-4-4 04:45 编辑

第8页73#楼合74#楼的程序单独都可以用,加载主程序中则需要加上去掉前导0的程序,稍加改动,重发如下:

Public Function MbC(D1 As String, D2 As String) As String
Dim X, Y ';两数长度
X = Len(D1) \ 4: Y = Len(D2) \ 4
D3 = String(4 * X + 4 - Len(D1), "0") & D1
D4 = String(4 * Y + 4 - Len(D2), "0") & D2
X = X + 1: Y = Y + 1
Dim A() As String
ReDim A(4 To 4 * X + 4 * Y, 4 To 4 * Y)
Dim I, J, C1, C2, CJ, JW, s, t
For J = 4 * Y To 4 Step -4 ';D2
JW = 0 ';进位清0
C2 = Mid(D4, J - 3, 4) ';每位数
For I = 4 * X To 4 Step -4 ';D1
C1 = Mid(D3, I - 3, 4) ';每位数
CJ = Val(C1) * Val(C2) + JW ';计算乘积
c = I + J: R = 4 * Y + 4 - J
A(c, R) = String(4 - Len(CJ Mod 10000), "0") & CJ Mod 10000 ';本位
JW = CJ \ 10000 ';进位
Next
A(c - 4, R) = JW
Next
Dim B() As String
ReDim B(1 To X + Y)
JW = 0
For s = X + Y To 1 Step -1
Bit = JW
For t = 1 To Y
Bit = Bit + Val(A(4 * s, 4 * t))
Next
B(s) = String(4 - Len(Bit Mod 10000), "0") & Bit Mod 10000
JW = Bit \ 10000
Next
If B(1) > 0 Then
MbC = Val(Left(MbC, 5)) & Mid(MbC, 6) & B(1)
Else
MbC = Val(Left(MbC, 5)) & Mid(MbC, 6)
End If
For s = 2 To X + Y
MbC = Val(Left(MbC, 5)) & Mid(MbC, 6) & B(s)
Next
End Function

'该程序已经做了修改,不是去掉前导0的问题,是补够前导0的问题。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-3-29 17:09 | 显示全部楼层
Public Function MbC(D1 As String, D2 As String) As String
Dim X, Y ';两数长度
X = Len(D1) \ 4: Y = Len(D2) \ 4
D3 = String(4 * X + 4 - Len(D1), "0") & D1
D4 = String(4 * Y + 4 - Len(D2), "0") & D2
X = X + 1: Y = Y + 1
Dim A() As String
ReDim A(4 To 4 * X + 4 * Y, 4 To 4 * Y)
Dim I, J, C1, C2, CJ, JW, s, t
For J = 4 * Y To 4 Step -4 ';D2
JW = 0 ';进位清0
C2 = Mid(D4, J - 3, 4) ';每位数
For I = 4 * X To 4 Step -4 ';D1
C1 = Mid(D3, I - 3, 4) ';每位数
CJ = Val(C1) * Val(C2) + JW ';计算乘积
c = I + J: R = 4 * Y + 4 - J
A(c, R) = String(4 - Len(CJ Mod 10000), "0") & CJ Mod 10000 ';本位
JW = CJ \ 10000 ';进位
Next
A(c - 4, R) = JW
Next
Dim B() As String
ReDim B(1 To X + Y)
JW = 0
For s = X + Y To 1 Step -1
Bit = JW
For t = 1 To Y
Bit = Bit + Val(A(4 * s, 4 * t))
Next
B(s) = String(4 - Len(Bit Mod 10000), "0") & Bit Mod 10000
JW = Bit \ 10000
Next
If B(1) > 0 Then
MbC = Val(Left(MbC, 5)) & Mid(MbC, 6) & B(1)
Else
MbC = Val(Left(MbC, 5)) & Mid(MbC, 6)
End If
For s = 2 To X + Y
MbC = Val(Left(MbC, 5)) & Mid(MbC, 6) & B(s)
Next
End Function

'该程序已经做了修改,不是去掉前导0的问题,是补够前导0的问题。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-3-29 17:52 | 显示全部楼层
本帖最后由 ysr 于 2021-3-29 11:43 编辑

99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999950000000000000000000000000000000000000000000000001*9=899999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999550000000000000000000000000000000000000000000000009有321位,用时0秒。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|数学中国 ( 京ICP备05040119号 )

GMT+8, 2024-12-22 14:27 , Processed in 0.093750 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表