home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 11
/
BUGCD1998_02.ISO
/
util
/
time2win
/
t2w32500.exe
/
_BIGNUM.FRM
< prev
next >
Wrap
Text File
|
1997-12-25
|
10KB
|
349 lines
VERSION 4.00
Begin VB.Form frmBigNumber
BorderStyle = 4 'Fixed ToolWindow
Caption = "Big Number"
ClientHeight = 4170
ClientLeft = 1890
ClientTop = 3270
ClientWidth = 7485
Height = 4575
Left = 1830
MaxButton = 0 'False
MDIChild = -1 'True
ScaleHeight = 4170
ScaleWidth = 7485
ShowInTaskbar = 0 'False
Top = 2925
Width = 7605
Begin Threed.SSPanel SSPanel1
Align = 1 'Align Top
Height = 465
Left = 0
TabIndex = 0
Top = 0
Width = 7485
_Version = 65536
_ExtentX = 13203
_ExtentY = 820
_StockProps = 15
ForeColor = -2147483640
BackColor = 12632256
Begin VB.ComboBox cmb_Function
Height = 315
Left = 1440
TabIndex = 1
Top = 90
Width = 5415
End
Begin Threed.SSCommand SSCommand1
Default = -1 'True
Height = 285
Left = 6930
TabIndex = 4
Top = 90
Width = 465
_Version = 65536
_ExtentX = 820
_ExtentY = 503
_StockProps = 78
Caption = "&Go"
BevelWidth = 1
Outline = 0 'False
End
Begin VB.Label Label1
Caption = "&Select a function"
Height = 255
Left = 90
TabIndex = 2
Top = 120
Width = 1275
End
End
Begin VB.Label lbl_Result
Appearance = 0 'Flat
BackColor = &H80000005&
BackStyle = 0 'Transparent
ForeColor = &H80000008&
Height = 3435
Left = 90
TabIndex = 3
Top = 630
Width = 7305
End
End
Attribute VB_Name = "frmBigNumber"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Option Base 1
Private Const Iteration = 250
Dim TimerStartOk As Integer
Dim TimerCloseOk As Integer
Dim TimerHandle As Integer
Dim TimerValue As Long
Private Sub cmb_Function_Click()
lbl_Result = ""
DoEvents
Select Case cmb_Function.ListIndex
Case 0
Call TestBigAdd
Case 1
Call TestBigDiv
Case 2
Call TestBigMul
Case 3
Call TestBigSub
End Select
End Sub
Private Sub Form_Activate()
mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
End Sub
Private Sub Form_Load()
Call sub_Load_Combo(cmb_Function, "c:\tmp\_bignum.t2w")
End Sub
Private Sub SSCommand1_Click()
Call cmb_Function_Click
End Sub
Private Sub TestBigAdd()
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim m1 As Double
Dim m2 As Double
Dim strM1 As String
Dim strM2 As String
strResult = ""
strDisplay = ""
Randomize Timer
m1 = 123456789012345#
m2 = 987654321098765#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Add '" & m1 & "' and '" & m2 & "' is '" & (m1 + m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Add '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigAdd(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr
strDisplay = strDisplay & "Big Num : Add '" & m1 & "' and '" & m2 & "' is '" & cBigNum(strM1, BIG_ADD, strM2) & "'" & vbCr & vbCr
m1 = 543210987654321#
m2 = 567890123456789#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Add '" & m1 & "' and '" & m2 & "' is '" & (m1 + m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Add '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigAdd(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr
strDisplay = strDisplay & "Big Num : Add '" & m1 & "' and '" & m2 & "' is '" & cBigNum(strM1, BIG_ADD, strM2) & "'" & vbCr & vbCr
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cBigAdd(cMKN(strM1), cMKN(strM2))
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestBigSub()
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim m1 As Double
Dim m2 As Double
Dim strM1 As String
Dim strM2 As String
strResult = ""
strDisplay = ""
Randomize Timer
m1 = 123456789012345#
m2 = 987654321098765#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Sub '" & m1 & "' and '" & m2 & "' is '" & (m1 - m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Sub '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigSub(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr
strDisplay = strDisplay & "Big Num : Sub '" & m1 & "' and '" & m2 & "' is '" & cBigNum(strM1, BIG_SUB, strM2) & "'" & vbCr & vbCr
m1 = 543210987654321#
m2 = 567890123456789#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Sub '" & m1 & "' and '" & m2 & "' is '" & (m1 - m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Sub '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigSub(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr
strDisplay = strDisplay & "Big Num : Sub '" & m1 & "' and '" & m2 & "' is '" & cBigNum(strM1, BIG_SUB, strM2) & "'" & vbCr & vbCr
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cBigSub(cMKN(strM1), cMKN(strM2))
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestBigDiv()
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim m1 As Double
Dim m2 As Double
Dim strM1 As String
Dim strM2 As String
strResult = ""
strDisplay = ""
Randomize Timer
m1 = 123456789012345#
m2 = 987654321098765#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Div '" & m1 & "' and '" & m2 & "' is '" & (m1 / m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Div '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigDiv(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr & vbCr
m1 = 543210987654321#
m2 = 567890123456789#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Div '" & m1 & "' and '" & m2 & "' is '" & (m1 / m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Div '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigDiv(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr & vbCr
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cBigDiv(cMKN(strM1), cMKN(strM2))
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub
Private Sub TestBigMul()
Dim strResult As String
Dim strDisplay As String
Dim i As Integer
Dim m1 As Double
Dim m2 As Double
Dim strM1 As String
Dim strM2 As String
strResult = ""
strDisplay = ""
Randomize Timer
m1 = 123456789012345#
m2 = 987654321098765#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Mul '" & m1 & "' and '" & m2 & "' is '" & (m1 * m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Mul '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigMul(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr
strDisplay = strDisplay & "Big Num : Mul '" & m1 & "' and '" & m2 & "' is '" & cBigNum(strM1, BIG_MUL, strM2) & "'" & vbCr & vbCr
m1 = 543210987654321#
m2 = 567890123456789#
strM1 = LTrim$(Str$(m1))
strM2 = LTrim$(Str$(m2))
strDisplay = strDisplay & "Double : Mul '" & m1 & "' and '" & m2 & "' is '" & (m1 * m2) & "'" & vbCr
strDisplay = strDisplay & "Big Double : Mul '" & m1 & "' and '" & m2 & "' is '" & cBigFmt(cBigMul(cMKN(strM1), cMKN(strM2)), 0) & "'" & vbCr
strDisplay = strDisplay & "Big Num : Mul '" & m1 & "' and '" & m2 & "' is '" & cBigNum(strM1, BIG_MUL, strM2) & "'" & vbCr & vbCr
lbl_Result = strDisplay
'time the function
TimerHandle = cTimerOpen()
TimerStartOk = cTimerStart(TimerHandle)
For i = 1 To Iteration
strResult = cBigMul(cMKN(strM1), cMKN(strM2))
Next i
mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
TimerCloseOk = cTimerClose(TimerHandle)
End Sub