Sign in to follow this  
Followers 0
LOULOU

Modulo of a great Number How to

3 posts in this topic

I want ot have the modulo of this great number

Mod(5117523067010037908340055150701,97)

But the result is false. It will be 80

How can i do to have the right result ?

Thanks

Share this post


Link to post
Share on other sites



Hi!

AutoIt doesn't support that big of a number (I don't think any language does that natively, that number is huuuuuge).

I came up with a solution though :)

MsgBox(0, "", _GreatMod("5117523067010037908340055150701","97"))
Func _GreatMod($num1, $num2)
    RegWrite("HKCU\Software\Microsoft\Calc","layout","REG_DWORD",0); So that calc.exe will have the right layut
    Opt("SendKeyDelay", 0)
    Opt("SendKeyDownDelay", 1)
    $fpid = Run("calc.exe", @SystemDir, @SW_HIDE); Doesn't hide the calculator for some unknown reason(!)
    WinWait("[CLASS:SciCalc]")
    ControlSend("[CLASS:SciCalc]", "", 403, $num1)
    Sleep(25 * StringLen($num1) + 20)
    ControlClick("[CLASS:SciCalc]", "", 94)
    ControlSend("[CLASS:SciCalc]", "", 403, $num2)
    Sleep(25 * StringLen($num2) + 20)
    ControlClick("[CLASS:SciCalc]", "", 112)
    $return = StringTrimRight(ControlGetText("[CLASS:SciCalc]", "", 403), 2)
    ProcessClose($fpid)
    Return $return
EndFunc  ;==>_GreatMod

:P


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Hi!

AutoIt doesn't support that big of a number (I don't think any language does that natively, that number is huuuuuge).

I came up with a solution though :)

MsgBox(0, "", _GreatMod("5117523067010037908340055150701","97"))
Func _GreatMod($num1, $num2)
    RegWrite("HKCU\Software\Microsoft\Calc","layout","REG_DWORD",0); So that calc.exe will have the right layut
    Opt("SendKeyDelay", 0)
    Opt("SendKeyDownDelay", 1)
    $fpid = Run("calc.exe", @SystemDir, @SW_HIDE); Doesn't hide the calculator for some unknown reason(!)
    WinWait("[CLASS:SciCalc]")
    ControlSend("[CLASS:SciCalc]", "", 403, $num1)
    Sleep(25 * StringLen($num1) + 20)
    ControlClick("[CLASS:SciCalc]", "", 94)
    ControlSend("[CLASS:SciCalc]", "", 403, $num2)
    Sleep(25 * StringLen($num2) + 20)
    ControlClick("[CLASS:SciCalc]", "", 112)
    $return = StringTrimRight(ControlGetText("[CLASS:SciCalc]", "", 403), 2)
    ProcessClose($fpid)
    Return $return
EndFunc ;==>_GreatMod

:P

Thanks for this formula doesn't works on French system

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