Jump to content

number fail help..i get 5.56e+031


Recommended Posts

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 by Mat
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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 precision

Number range (integers): 64-bit signed integer

Hexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)

I just read the bottom line.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

@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 here
RegExp tutorial: enough to get started
PCRE 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

  • Moderators

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. :mellow:

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 here
RegExp tutorial: enough to get started
PCRE 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

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 precision

Number range (integers): 64-bit signed integer

Hexadecimal numbers: 32-bit signed integer (0x80000000 to 0x7FFFFFFF)

I just read the bottom line.

M23

I 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

Link to comment
Share on other sites

  • Moderators

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! :mellow:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

whatever Edited 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 ...
 

Link to comment
Share on other sites

@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 here
RegExp tutorial: enough to get started
PCRE 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

wipped. In case you did not get around to it.

#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)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...