Jump to content

Recommended Posts

Posted (edited)

  On 6/16/2010 at 3:21 PM, 'MvGulik said:

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
  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

@Melba: did you get it?

  Reveal hidden contents

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)

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

No, not at all what I meant!

0x4772616E74656421 = Binary("Granted!")

  Reveal hidden contents

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)

Posted

  On 6/16/2010 at 5:03 PM, 'Melba23 said:

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

  • Moderators
Posted

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:

  Reveal hidden contents

 

Posted

@Melba: you're making too many holes a day...

@Collatz: at least, use compression to halve the number of odd values.

  Reveal hidden contents

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)

Posted

  On 6/17/2010 at 1:55 AM, 'MvGulik said:

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)

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
  • Recently Browsing   0 members

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