VB big data processing program -- can calculate the power of any large number

Source: Internet
Author: User

Private sub commandementclick ()
Command1.caption = "Please wait for the calculation result"
Stmer = Timer
Text3.text = POW (text1.text, text2.text)
Text4.text = timer-stmer & "seconds"
If text6.text = "" then
Text6.text = inputbox ("Enter the number you want to divide", "Remove the remainder of an integer from a large number ")
End if
Text7.text = modmax (text3.text, Val (text6.text ))
Text5.text = Len (TRIM (text3.text ))
Command1.caption = "computing completed"
End sub
Function POW (byval X as string, byval y as string) as string
Dim le1 as long, le as long, same as string, CH2 as string, CH3 as string
Dim w as long, fistshu as integer, secondshu as integer, N as integer, t as integer, M as integer
Bytes = x
Le1 = Len (X)
CH2 = ""
For I = 2 to Val (y)
For J = le1 to 1 step-1
N = le1-J
M = Val (mid (x, J, 1 ))
Secondshu = 0
Le2 = Len (rows)
While le2
T = Val (mid (values, le2, 1 ))
W = m * t
If n = 0 or Len (CH2)-N = 0 then
Firstshu = W mod 10 + secondshu
Else
Firstshu = W mod 10 + secondshu + val (mid (CH2, Len (CH2)-N, 1 ))
End if
Secondshu = W/10
If firstshu> = 10 then
Secondshu = secondshu + firstshu/10
Firstshu = firstshu mod 10
End if
If n = 0 or Len (CH2)-N = 0 then
CH2 = firstshu & trim (CH2)
Else: Mid (CH2, Len (CH2)-N, 1) = firstshu
N = n + 1
End if
Le2 = le2-1
Wend
Next J
If secondshu <> 0 then
Second = secondshu & CH2
Else: shard = CH2
End if
CH2 = ""
Next I
Pow = Signature
End Function

'Here is the remainder.

Function modmax (byval X as string, byval y as string)
Dim wshu as integer, le1 as integer
If y = 0 then
Exit Function
End if
Wshu = Len (TRIM (x ))
For I = 1 to wshu
Q = Val (P & Mid (TRIM (x), I, 1 ))
P = Q mod y
Next I
Modmax = P
End Function

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.