Sign in to follow this  
Followers 0
nullschritt

Get autoit to do accurate math

3 posts in this topic

It seems that after mutliplying a number so many time over, it becomes impossible to reverse it to it's original value.

It seems this is because autoit automatically does scientific notation, and automatically rounds off the decimal place. (like this 7.222782900955e+50)

Is there any way to make autoit return the WHOLE accurate number?

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Thanks, I am doing this with matrix mathematics though, I have my doubts as to the efficiency of calling this udf to preform the math for every equation(as matrix multiplication, and inversion require a lot of calculations), but I will report the results.

Edit: Yep it has increased the execution time by 10,000+X (had to kill the process it was taking so long)

Changed

For $i = 0 To $n-1
For $j = 0 To $p-1
For $k = 0 To $m-1
$s = $s + $A [$i][$k] * $B [$k][$j]
Next
$C [$i][$j] = $s
$s = 0
Next
Next

to

For $i = 0 To $n-1
For $j = 0 To $p-1
For $k = 0 To $m-1
$s = _BigNum_Mul(_BigNum_Add($s, $A[$i][$k]), $B[$k][$j])
Next
$C [$i][$j] = $s
$s = 0
Next
Next

Any other suggestions, or perhaps a way to do the same thing with matricies (like maybe a bignum_mMult(matrix1, matrix2) )?

Edited by nullschritt

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