czardas Posted September 1, 2015 Share Posted September 1, 2015 What do you get if you run this code?ConsoleWrite(-9223372036854775808 & @LF)I just would like to know if the value changes or not. Thanks. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
guinness Posted September 1, 2015 Share Posted September 1, 2015 The value changed. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
czardas Posted September 1, 2015 Author Share Posted September 1, 2015 It's not only me then. Thanks. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
kcvinu Posted September 1, 2015 Share Posted September 1, 2015 Only the last digit is changed Spoiler My Contributions Glance GUI Library - A gui library based on Windows api functions. Written in Nim programming language. UDF Link Viewer --- A tool to visit the links of some most important UDFs Includer_2 ----- A tool to type the #include statement automatically Digits To Date ----- date from 3 integer values PrintList ----- prints arrays into console for testing. Alert ------ An alternative for MsgBox MousePosition ------- A simple tooltip display of mouse position GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function Access_UDF -------- An UDF for working with access database files. (.*accdb only) Link to comment Share on other sites More sharing options...
jpm Posted September 1, 2015 Share Posted September 1, 2015 some bug for Max negative Int64 Link to comment Share on other sites More sharing options...
jchd Posted September 1, 2015 Share Posted September 1, 2015 This is the drawback of 2's complement representation: the range isn't symetric around zero. So -(-128 ) isn't representable as a signed byte, up to whatever fixed integral size your hardware/software handles.1's complement doesn't have the issue, but then you end up with another problem: you get distinct values for +0 and -0. jvanegmond 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
iamtheky Posted September 1, 2015 Share Posted September 1, 2015 why do the top two work?ConsoleWrite(int("-9223372036854775808" , 2) & @LF) ConsoleWrite(number("-9223372036854775808" , 2) & @LF) ConsoleWrite(-9223372036854775808 & @LF) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Gianni Posted September 1, 2015 Share Posted September 1, 2015 even this will change:ConsoleWrite(9223372036854775808 & @LF)the reason is that:Maximum value for a number of type int64 is 9223372036854775807 --> 0111111111111111111111111111111111111111111111111111111111111111Minimum value for a number of type int64 is -9223372036854775807 --> 1000000000000000000000000000000000000000000000000000000000000001 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
jchd Posted September 1, 2015 Share Posted September 1, 2015 (edited) I honestly don't remember which machine/processor used 1's complement and used all zeroes to denote +/- zero but the value normally assigned to -0 was used to denote overflow. That was much easier to deal with and I believe it's only for historical inheritance that we have to cope with asymetry in integral representations. It's a pity for it would be much easier to work with that, now that gate count is essentially irrelevant. Geez, compatibility, what hard ways you force us to walk thru.Minimum value for a number of type int64 is -9223372036854775807 --> 1000000000000000000000000000000000000000000000000000000000000001Wrong: substract 1 to that. Edited September 1, 2015 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
iamtheky Posted September 1, 2015 Share Posted September 1, 2015 Minimum value for a number of type int64 is -9223372036854775807 --> 1000000000000000000000000000000000000000000000000000000000000001 but int and number can reach -9223372036854775808ConsoleWrite(int("-9223372036854775810" , 2) & @LF) ConsoleWrite(number("-9223372036854775810" , 2) & @LF) ConsoleWrite(-9223372036854775810 & @LF) ConsoleWrite(int("-9223372036854775809" , 2) & @LF) ConsoleWrite(number("-9223372036854775809" , 2) & @LF) ConsoleWrite(-9223372036854775809 & @LF) ConsoleWrite(int("-9223372036854775808" , 2) & @LF) ConsoleWrite(number("-9223372036854775808" , 2) & @LF) ConsoleWrite(-9223372036854775808 & @LF) ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Gianni Posted September 1, 2015 Share Posted September 1, 2015 evidently int () and number () can handle even the value -9223372036854775808 ->1000000000000000000000000000000000000000000000000000000000000000while ConsoleWrite don't accept this value limit .... Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
Gianni Posted September 1, 2015 Share Posted September 1, 2015 try this:each value greater then 9223372036854775807 is truncated to 9223372036854775807 by ConsoleWriteeach value lower than -9223372036854775807 is truncated to -9223372036854775807 by ConsoleWriteConsoleWrite(9223372036854775809999999 & @LF) ConsoleWrite(92233720368547758099999 & @LF) ConsoleWrite(922337203685477580999 & @LF) ConsoleWrite(92233720368547758099 & @LF) ConsoleWrite(9223372036854775809 & @LF) ConsoleWrite(9223372036854775808 & @LF) ConsoleWrite(9223372036854775807 & @LF) ; <--- upper limit ConsoleWrite(9223372036854775806 & @LF) ConsoleWrite(-9223372036854775806 & @LF) ConsoleWrite(-9223372036854775807 & @LF) ; <--- lower limit ConsoleWrite(-9223372036854775808 & @LF) ConsoleWrite(-9223372036854775809 & @LF) ConsoleWrite(-92233720368547758099 & @LF) ConsoleWrite(-922337203685477580999 & @LF) ConsoleWrite(-92233720368547758099999 & @LF) ConsoleWrite(-9223372036854775809999999 & @LF) Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
jpm Posted September 1, 2015 Share Posted September 1, 2015 certainly due to string conversion = bug Link to comment Share on other sites More sharing options...
jchd Posted September 1, 2015 Share Posted September 1, 2015 Yep:Local $n = 0x8000000000000000 ConsoleWrite($n & @LF) This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Gianni Posted September 1, 2015 Share Posted September 1, 2015 Wrong: substract 1 to that.yes.... weirdness....ConsoleWrite(-9223372036854775807 & @LF) ; -9223372036854775807 1000000000000000000000000000000000000000000000000000000000000001 ConsoleWrite(-9223372036854775807 - 1 & @LF) ; -9223372036854775808 1000000000000000000000000000000000000000000000000000000000000000 <-- OK ConsoleWrite(-9223372036854775807 - 2 & @LF) ; 9223372036854775807 0111111111111111111111111111111111111111111111111111111111111111 <-- wrap around ConsoleWrite(-9223372036854775807 - 3 & @LF) ; 9223372036854775806 0111111111111111111111111111111111111111111111111111111111111110 ConsoleWrite(-9223372036854775807 - 4 & @LF) ; 9223372036854775805 0111111111111111111111111111111111111111111111111111111111111101 ConsoleWrite(@LF) ConsoleWrite(9223372036854775807 & @LF) ; 9223372036854775807 0111111111111111111111111111111111111111111111111111111111111111 ConsoleWrite(9223372036854775807 + 1 & @LF) ; -9223372036854775808 1000000000000000000000000000000000000000000000000000000000000000 <-- wrap around ConsoleWrite(9223372036854775807 + 2 & @LF) ; -9223372036854775807 1000000000000000000000000000000000000000000000000000000000000001 ConsoleWrite(9223372036854775807 + 3 & @LF) ; -9223372036854775806 1000000000000000000000000000000000000000000000000000000000000010 ConsoleWrite(9223372036854775807 + 4 & @LF) ; -9223372036854775805 1000000000000000000000000000000000000000000000000000000000000011 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt.... Link to comment Share on other sites More sharing options...
czardas Posted September 1, 2015 Author Share Posted September 1, 2015 (edited) certainly due to string conversion = bugThis was my conclusion too. I discovered this when passing the number to the Execute() function. I wasn't sure though, has anyone opened a ticket or shall I do it?EditActually it looks as if it's already been reported https://www.autoitscript.com/trac/autoit/ticket/3017No mention of string conversion in that ticket though. I added a comment regarding this. Geez, compatibility, what hard ways you force us to walk thru.Understatement! Edited September 1, 2015 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
czardas Posted September 1, 2015 Author Share Posted September 1, 2015 (edited) why do the top two work?ConsoleWrite(int("-9223372036854775808" , 2) & @LF) ConsoleWrite(number("-9223372036854775808" , 2) & @LF) ConsoleWrite(-9223372036854775808 & @LF)No internal conversion to string takes place in the top two lines - which supports the conclusion. Hmm I'm not sure about this actually. It's not making much sense to me right now.Here's how I stumbled upon this - fortunately before I posted another broken example script.ConsoleWrite((Execute(0x8000000000000000 & " - 0") = 0x8000000000000000 - 0) & @LF) ; False ??? ConsoleWrite((Execute(0x8000000000000000 & " - 0") = 0x8000000000000000 + 1) & @LF) ; True ^^ Edited September 1, 2015 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
jchd Posted September 1, 2015 Share Posted September 1, 2015 There is indeed something wrong under the ice.There is also something plain wrong with / and ^ operators acting on integers. I'll report about this as soon as I find time to fully characterize the issue. In short, such operation is currently put in (dirty) hands of floating-point and of course the result can be badly wrong because FP can't always deliver enough precision to represent the result. This despite the fact that it's almost impossible to run current OSes on hardware not featuring 80-bit FP but I ain't doing to dig further into FP guts. Arithmetic over integers should never deliver a FP result when it can be represented as an integer.Also it's a shame that integral division doesn't deliver both the (integral) quotient and rest. @extended is a perfect receptacle for that.Euclid, please, come back. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
jchd Posted September 1, 2015 Share Posted September 1, 2015 FYI I just changed ticket https://www.autoitscript.com/trac/autoit/ticket/3017 title to match the actual issue it brings. Hope this is OK. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
czardas Posted September 1, 2015 Author Share Posted September 1, 2015 Euclid, please, come back.and bring J. S. Bach with you! mLipok 1 operator64 ArrayWorkshop 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