WolfWorld Posted September 13, 2008 Posted September 13, 2008 (edited) #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: Athiwat Chunlakhan Script Function: _Mod($b, $e, $m) Submit as an UDF #ce ---------------------------------------------------------------------------- $b = 4 $e = 13 $m = 497 MsgBox(0, 'Mod', Mod($b ^ $e, $m)) ; This return the right value MsgBox(0, '_Mod', _Mod($b, $e, $m)) ; This return the right value $b = 444 $e = 5555 $m = 455 MsgBox(0, 'Mod', Mod($b ^ $e, $m)) ; This return the WRONG value MsgBox(0, '_Mod', _Mod($b, $e, $m)) ; This return the right value Func _Mod($b, $e, $m) ; Base, power, mod Local $c = 1 For $i = 1 to $e $c = Mod($c * $b, $m) Next Return $c EndFunc ;==>_Mod Edited September 14, 2008 by athiwatc Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets!
martin Posted September 13, 2008 Posted September 13, 2008 #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.12.1 Author: Athiwat Chunlakhan Script Function: _Mod($b, $e, $m) Submit as an UDF#ce ----------------------------------------------------------------------------$b = 4$e = 13$m = 497MsgBox(0, 'Mod', Mod($b ^ $e, $m)) ; This return the right valueMsgBox(0, '_Mod', _Mod($b, $e, $m)) ; This return the right value$b = 444$e = 5555$m = 455MsgBox(0, 'Mod', Mod($b ^ $e, $m)) ; This return the WRONG valueMsgBox(0, '_Mod', _Mod($b, $e, $m)) ; This return the right valueFunc _Mod($b, $e, $m) ; Base, power, mod Local $c = 1, $eIN = 0 While $eIN < $e $eIN += 1 $c = Mod($c * $b, $m) WEnd Return $cEndFunc ;==>_ModCode tags around your scripst would improve the look.Looks very similar to this.. I think the for/next loop would be faster. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
WolfWorld Posted September 14, 2008 Author Posted September 14, 2008 Code tags around your scripst would improve the look.Looks very similar to this.. I think the for/next loop would be faster.Oops, I don't know Its already there Main project - Eat Spaghetti - Obfuscate and Optimize your script. The most advance add-on.Website more of GadGets!
martin Posted September 14, 2008 Posted September 14, 2008 Oops, I don't know Its already thereWell great minds you know Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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