Mat Posted June 16, 2010 Posted June 16, 2010 (edited) Yep. Like using floats type variables with 2^x while they where taking about Integer type variable.Wow... never knew that.9187343239835812094 then. (wait... I keep getting different values)Edit: 921886843722740633 ????Edit: dividing does as well. Edited June 16, 2010 by Mat AutoIt Project Listing
Mat Posted June 16, 2010 Posted June 16, 2010 Kk, last post then I'm done. Dividing also changes the variable to a double. $ni = 61 $n = Int(2 ^ $ni) $i = Int(2 ^ 62) While 1 While Not StringInStr($i + $n, "e") And $i + $n > 0 $i += $n ToolTip($i) WEnd If $n <= 1 Then ExitLoop $ni -= 1 $n = Int(2 ^ $ni) WEnd ToolTip("") ClipPut($i) ; 9223372036854775807 AutoIt Project Listing
Moderators Melba23 Posted June 16, 2010 Moderators Posted June 16, 2010 Mat,I got those limits from the Help file<AutoIt - Frequently Asked Questions (FAQ)>FAQ 15. What are the current technical limits of AutoIt v3?.Number range (floating point): 1.7E–308 to 1.7E+308 with 15-digit precisionNumber range (integers): 64-bit signed integerHexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)I just read the bottom line.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
jchd Posted June 16, 2010 Posted June 16, 2010 @Melba: did you get it? 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)
Moderators Melba23 Posted June 16, 2010 Moderators Posted June 16, 2010 jchd,Get what?I just trust what our beloved Devs put in the Help file. If what I quoted from there is wrong, could one of you please put a bug report in Trac, because like wipped - I am not really following. Big numbers always made my head hurt - I much prefer exponentials and limited decimal places. I always thought this summed up the need for accuracy in the real world:Measure it with a micrometer (engineer)Mark it with a pencil (mechanic)Cut it with an axe (workman)M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
jchd Posted June 16, 2010 Posted June 16, 2010 No, not at all what I meant! 0x4772616E74656421 = Binary("Granted!") 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)
Mat Posted June 16, 2010 Posted June 16, 2010 Mat,I got those limits from the Help file<AutoIt - Frequently Asked Questions (FAQ)>FAQ 15. What are the current technical limits of AutoIt v3?.Number range (floating point): 1.7E–308 to 1.7E+308 with 15-digit precisionNumber range (integers): 64-bit signed integerHexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)I just read the bottom line.M23I know... and its accurate, the problem is that using certain functions on a number in AutoIt causes it to be cast into a different format, and hence the limit changes. MvGulik pointed out that's what I was doing wrong when I was using the ^ operator, but it also happens when you divide. Both are because it is likely that the result is a decimal, although in the context of what I was doing they wouldn't be.The one part of that faq that needs to be changed is the line length limit as that is now removed (Or at least part removed...)Mat AutoIt Project Listing
Moderators Melba23 Posted June 16, 2010 Moderators Posted June 16, 2010 jchd,Sorry, I am being slow tonight - 2 rounds of golf today (2 under and 3 under!) on a nice course under a perfect blue sky makes M23 a tired boy! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
MvGulik Posted June 17, 2010 Posted June 17, 2010 (edited) whatever Edited February 7, 2011 by MvGulik "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ...
jchd Posted June 17, 2010 Posted June 17, 2010 @Melba: you're making too many holes a day... @Collatz: at least, use compression to halve the number of odd values. 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)
Mat Posted June 17, 2010 Posted June 17, 2010 wipped. In case you did not get around to it.expandcollapse popup#include "BigNum.au3" Func main() Local $sSequance = collatz(15) MsgBox(0,'MsgBox','$sSequance = ' & $sSequance & @CRLF) $sSequance = collatz(27) MsgBox(0,'MsgBox','$sSequance = ' & $sSequance & @CRLF) EndFunc Func collatz($iNumber) If Not IsInt($iNumber) Then Return SetError(1, 0, 0) ;; eliminate anything not being a integer number. If VarGetType($iNumber) = 'double' Then Return SetError(2, 0, 0) ;; eliminate double type. (integer float) Local Const $sDelimiter = '|' Local $sN = String($iNumber) ;; make string, for use with BigNum UDF. (might not be needed, just taking the save road.) Local $sSequence = $sN ;; easy and fast sequence collection. While $sN <> '1' If Number(_BigNum_Mod($sN, '2')) Then $sN = _BigNum_Mul($sN, '3') $sN = _BigNum_Add($sN, '1') Else $sN = _BigNum_Div($sN, '2') EndIf $sSequence &= $sDelimiter & $sN WEnd Return $sSequence EndFunc main() Exit Thats fast. try: collatz(154564565465454656421) AutoIt Project Listing
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