Xenobiologist Posted January 9, 2008 Share Posted January 9, 2008 (edited) Hi,I opened this thread : Linkto discuss whether there should be poping up an error message when Autoit works with numbers greater than its limit. Global Const $zahl1 = 132132132343242349898989898989834324234 $Vartype=VarGetType($zahl1) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $Vartype = ' & $Vartype & @crlf);### Debug Console ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $zahl1 = ' & $zahl1 & @crlf);### Debug Console Global Const $zahl2 = "132132132343242349898989898989834324234" ConsoleWrite(StringLen($zahl1) & @CRLF) ConsoleWrite(StringLen($zahl2) & @CRLF)oÝ÷ Ø¢+ly鬶Þvçéz»-¢+l)¢´¸¤y«¢+Ù5Í ½à À°ÅÕ½ÐìüüüÅÕ½Ðì°ÌäíAÍÍèÌäìµÀìÌäìäääääääääääääääääääÌäìµÀì I1µÀì|(ÌäíÍ¡½ÝèÌäìµÀìäääääääääääääääääää¤But this can lead to unknown errors, cause Autoit seems to work with this huge numbers, but it doesn't and it doesn't show it to the user.So my question is: is it normal that there isn't an overflow protection in languages like AutoIt?Edit: SpellingSo long,Mega Edited January 10, 2008 by Xenobiologist Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 10, 2008 Author Share Posted January 10, 2008 Hi, really nobody an opinion referring to the topic? Or do just have to wait? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
weaponx Posted January 10, 2008 Share Posted January 10, 2008 ;23 digits (99999999999999999999999), truncates to 19 digits (9223372036854775807) $var = 99999999999999999999999 ConsoleWrite("String: " & String($var) & @CRLF) ConsoleWrite("Number: " & $var)This is only a problem if you are working with U.S. National deficit. Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 10, 2008 Author Share Posted January 10, 2008 Hi,haha , Germans are a bit better : German deficitAlthough, this doesn't answer my question.So my question is: is it normal that there isn't an overflow protection in languages like AutoIt?So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Valik Posted January 10, 2008 Share Posted January 10, 2008 As far as I'm concerned, AutoIt's behavior is fine. Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 10, 2008 Author Share Posted January 10, 2008 As far as I'm concerned, AutoIt's behavior is fine.Hi,hmmh ok. Maybe it is worth a sentence in the helpfile that huge numbers are reduced to the limit which Autoit can handle and that this may cause problems dealing with these huge numbers.I do not know how other languages deal with this problem, but I'll have a look. Hopefully, Jon does the same. (So this is works as designed)So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Valik Posted January 10, 2008 Share Posted January 10, 2008 They are not reduced. Whichever bits happen to be set are set. It's like trying to fit 32-bits into 16-bits. Only part of it can be represented so however those bits end up is what the 16-bit value will end up being. Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 10, 2008 Author Share Posted January 10, 2008 They are not reduced. Whichever bits happen to be set are set. It's like trying to fit 32-bits into 16-bits. Only part of it can be represented so however those bits end up is what the 16-bit value will end up being.Hi,yeah I know what the problem is. (No need for pleonasm) But I guess, there are systems which split the number to calculate higher numbers of something like that. Anyway, I vote for documentation and everything is fine. So long,Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 15, 2008 Author Share Posted January 15, 2008 HI, I guess other languages treat it similar. @Jon : What do you think? So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
Nutster Posted January 16, 2008 Share Posted January 16, 2008 We are pretty much inheriting the behaviour from C++, which AutoIt is written in. In C++, integers silently roll-over during over-flow. If you want to keep the size of the number, but are willing to sacrifice some of the precision, put a decimal point on the end and turn it into a floating-point number. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
Xenobiologist Posted January 16, 2008 Author Share Posted January 16, 2008 We are pretty much inheriting the behaviour from C++, which AutoIt is written in. In C++, integers silently roll-over during over-flow. If you want to keep the size of the number, but are willing to sacrifice some of the precision, put a decimal point on the end and turn it into a floating-point number. Hi, yeah I know about the tunring into negative values. You mean like this: Global Const $zahl1 = 9223372036854775800 Global Const $zahl2 = 9223372036854775800.00 For $i = 1 To 10 Step 1 ConsoleWrite("---" & @CRLF) ConsoleWrite("Zahl1 :" & $zahl1 + $i & @CRLF) ConsoleWrite("Zahl2 :" & $zahl2 + $i & @CRLF) ConsoleWrite("Zahl3 :" & $zahl2 * $i & @CRLF) Next So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
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