Sign in to follow this  
Followers 0
jennico

please need help with dllstructs and arithmetics

2 posts in this topic

#1 ·  Posted (edited)

hi there,

i need to operate with large integers. example:

Mod(2121233235543365*2121233235543365,5232225434356058)

the result must be smaller than 5232225434356058, but autoit cannot handle the intermediate product.

so i tried it with dllcalls :

Dim $tStruct = DllStructCreate("double");or uint64 or int64 ?
DllStructSetData($tStruct, 1, DllStructGetData($tStruct, 1) +2121233235543365)
DllStructSetData($tStruct, 1, DllStructGetData($tStruct, 1) *2121233235543365)
DllStructSetData($tStruct, 1, DllStructGetData($tStruct, 1) /5232225434356058)
MsgBox(0,"result=",DllStructGetData($tStruct, 1))

the result (an integer) is correct so far. but i wanted a modulo operation.

can anyone tell me the equivalent so that i can get the remainder and not the integer part of the division ?

thx j.

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

Share this post


Link to post
Share on other sites



hi there,

i need to operate with large integers. example:

Mod(2121233235543365*2121233235543365,5232225434356058)

the result must be smaller than 5232225434356058, but autoit cannot handle the intermediate product.

so i tried it with dllcalls :

Dim $tStruct = DllStructCreate("double");or uint64 or int64 ?
DllStructSetData($tStruct, 1, DllStructGetData($tStruct, 1) +2121233235543365)
DllStructSetData($tStruct, 1, DllStructGetData($tStruct, 1) *2121233235543365)
DllStructSetData($tStruct, 1, DllStructGetData($tStruct, 1) /5232225434356058)
MsgBox(0,"result=",DllStructGetData($tStruct, 1))

the result (an integer) is correct so far. but i wanted a modulo operation.

can anyone tell me the equivalent so that i can get the remainder and not the integer part of the division ?

thx j.

Have you tried this on a 64bit OS, with the 64bit compile option of AutoIt? And is your sig really saying you are running version 3.2.8.1 of AutoIt?

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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