Post by skary on Apr 21, 2009 9:06:58 GMT -5
Hi
I'm new of this forum (hem sorry for my english is not my language and i speak it just a little).
I'have search documentation about BigInteger (of VbCorLib) but i have found nothing.
Some who know a place where i can retrive any information ?
Because i whant to do a kind of big double manager , and for do it i would use the big integer.
This is the code i have written for the sum method :
Thanks
I'm new of this forum (hem sorry for my english is not my language and i speak it just a little).
I'have search documentation about BigInteger (of VbCorLib) but i have found nothing.
Some who know a place where i can retrive any information ?
Because i whant to do a kind of big double manager , and for do it i would use the big integer.
This is the code i have written for the sum method :
Private Number1 As BigInteger
Private Number2 As BigInteger
Public Function Sum(First_Number As String, Second_Number As String)
Dim A1 As String
Dim A2 As String
Dim H As Long
Dim J As Long
Dim Result As String
Dim EntryPoint As Long
Set Number1 = New BigInteger
Set Number2 = New BigInteger
H = FormatDouble(First_Number)
J = FormatDouble(Second_Number)
If J > H Then
H = J
End If
A1 = Replace(First_Number, ".", "", 1)
A2 = Replace(Second_Number, ".", "", 1)
Number1 = ParseArgument(A1) '<< expecially here i have no idea how to assign a string to a big integer
Number2 = ParseArgument(A2)
Result = Number1.Add(Number2).ToString
EntryPoint = Len(Result) - H
Result = Mid$(Result, 1, EntryPoint) & "." & Mid$(Result, EntryPoint + 1, Len(Result))
Sum = Result
Set Number1 = Nothing
Set Number1 = Nothing
End Function
Private Function FormatDouble(Number As String)
Number = Replace(Number, ",", ".", 1)
FomratDouble = Len(Number) - InStr(1, Number, ".", vbTextCompare)
End Function
Thanks