Sign in to follow this  
Followers 0
fry

Math Problem,in Autoit That Is

3 posts in this topic

Okies,as i've gotten the last part worked out and running fine thanks to many kind members on this forum,it's time to move on to the one I figured would be the hardest.Same project different part.I need to add to large numbers together and then use the result in an equation.Whats horrible is first of all I can't figure out the equation on paper/in my head much less codeing it.But since I can;t even get the 2 values to add together and it show correctly it's not worth worying about at this point.Below is an example of what i'm now trying to do.I first need to round these two numbers by 2.I know that the rounding of the 2 numbers by 2 is part of the equation,I just can't get the rest lol.Now after the two numbers have been rounded they need to be added together and this is the bad part,they are huge.Example 25766891049 + 4038030212 .If i'm not mistaken both of those numbers are too large to handle in autoit,that is unless one of you know of a way to break down the numbers and then somehow reassemble the answer correctly.If anyone can help me with this problem it would be greatly appreciated. :D

Share this post


Link to post
Share on other sites



Is there anyway to establish the variable as a 'Long'. If I remember back to my good 'old C programming days... you could set variables to some sort of long-thingy and it'd be able to hold mucho-numberos.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

autoit3 can hold up to 15 digits...from the helpfile:

A "double precision" number which is a 15 digit precision number in the range 1.7E308 to 1.7E+308.  (Stored internally as 8 bytes)

maybe this gets you started:

$A = 25766891049
$B = 4038030212
$C = Round2($A) + Round2($B)
MsgBox(0, 'test', $C)

Func Round2($I_A)
   $I_A1 = Number(StringRight($I_A, 1)) / 2
   If $I_A1 <> Int($I_A1) Then $I_A = $I_A + 1
   return ($I_A)
EndFunc  ;==>Round2
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0