回复 88楼 wmf2014
这个文件打不开,我的电脑没有打开此文件的程序需要下载其他程序,也不知道啥样的程序。
谢谢您!
下面发个除法程序,只发主程序,也是个可调用程序。太慢,不断调用乘法比较大小,加法减法,若把乘法等程序速度提高了,程序是不是能用也不知道,发一下仅供参考。
Public Function MCC1(D1 As String, D2 As String) As String ';大整数的除法
Dim ss
ss = MBJC(D1, D2)
If ss = -1 Then
MCC1 = "0" & "/" & D1
Else
If ss = 0 Then
MCC1 = 1
Else
If Len(D2) < 9 Then
MCC1 = MCC(Trim(D1), Trim(D2))
Else
x = Len(D1) - Len(D2)
d4 = D1
If x <= 3 Then
x = 3
B = 0
Else
a = Log(2) / Log(10)
X1 = x
B = Int(X1 * Val(a))
Do While B >= x
X1 = X1 + 1
B = Int(X1 * Val(a))
Loop
B = X1 - 1
End If
c = 1
Do Until i = B
i = i + 1
c = MbC(Trim(c), 2)
Loop
i1 = B
Do While MBJC(Trim(D1), MbC(Trim(D2), Trim(c))) = 1
i1 = i1 + 1
c = MbC(Trim(c), 2)
Loop
c = 1
Do Until i2 = i1 - 1
c = MbC(Trim(c), 2)
i2 = i2 + 1
Loop
D1 = MPC(Trim(D1), MbC(Trim(D2), Trim(c)))
D3 = c
C1 = c
D1 = MPC(Trim(d4), MbC(Trim(D3), Trim(D2)))
d5 = D1
If x >= 15 Then
x = x + 2
Else
x = x
End If
Do Until i2 <= x
c = 1
i1 = 0
Do While MBJC(Trim(D1), MbC(Trim(D2), Trim(c))) = 1
i1 = i1 + 1
c = MbC(Trim(c), 2)
Loop
i2 = 0
c = 1
Do Until i2 = i1 - 1
c = MbC(Trim(c), 2)
i2 = i2 + 1
Loop
D1 = MPC(Trim(D1), MbC(Trim(D2), Trim(c)))
D3 = MPC1(Trim(D3), Trim(c))
C1 = c
Print i2, D3
Loop
Do While MBJC(Trim(d4), MbC(Trim(D3), Trim(D2))) > 0
D3 = MPC1(Trim(D3), 1)
Loop
If MBJC(Trim(d4), MbC(Trim(D3), Trim(D2))) < 0 Then
D3 = MPC(Trim(D3), 1)
Else
D3 = D3
End If
JW = MPC(Trim(d4), MbC(Trim(D3), Trim(D2)))
If MBJC(Trim(JW), 0) = 0 Then
MCC1 = D3
Else
MCC1 = D3 & "/" & JW
End If
End If
End If
End If
End Function