Guest Lucas Posted August 29, 2005 Posted August 29, 2005 Is Biginteger possible with AutoIt: Something like this: a=12345234532453454576357673567463245342635525324534567890 b=2323453245234532454352452352352345235354567 [...] a/b=5313313085930 a%b=2287874721508099322718185501018800045625580
LxP Posted August 29, 2005 Posted August 29, 2005 Welcome to the forums! Currently this functionality is not available. It would be possible to program some AutoIt code to manipulate such large numbers to an extent though (where they can be handled as a string -- e.g. addition, subtraction and modulus are easy because they can be done on a digit-by-digit basis).
Lucasgrijander Posted February 17, 2006 Posted February 17, 2006 (edited) Can anybody post a examples or DLL to import? Edited February 17, 2006 by Lucasgrijander
Moderators SmOke_N Posted February 17, 2006 Moderators Posted February 17, 2006 Can anybody post a examples or DLL to import?Um... a bit to much to drink tonite? What does your question have to do with this topic, and if it does have to do with this topic, why weren't you more specific on what you wanted? And if your the original poster, what's up with the different name? And since I'm asking so many questions, why aren't I in bed? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Lucasgrijander Posted February 17, 2006 Posted February 17, 2006 Is possible addition, subtraction, modulus... of bigintegers in Autoit?
LxP Posted February 19, 2006 Posted February 19, 2006 Can anybody post a examples or DLL to import?Here's an example to add big integers stored in string format. It only works for positive integers (unexpected results will occur if the strings contain anything other than digits). Local $A = '12345234532453454576357673567463245342635525324534567890' Local $B = '2323453245234532454352452352352345235354567' MsgBox(0, "$A + $B", Add($A, $B)) Func Add($1, $2) Local $Output = '' Local $DigitSum = 0 While $1 <> '' Or $2 <> '' $DigitSum += StringRight($1, 1) + StringRight($2, 1) $Output = Mod($DigitSum, 10) & $Output $DigitSum = Int($DigitSum / 10) $1 = StringTrimRight($1, 1) $2 = StringTrimRight($2, 1) WEnd If $DigitSum Then $Output = $DigitSum & $Output Return $Output EndFunc It's not the most efficient code but it proves that it's possible.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now