Jump to content

Recommended Posts

Posted (edited)

You can add 3 AutoIt types: Keyword, Function and UserFunction. Also you can differentiate between Int32, Int64, Double and float signals.

Edited 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 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 (edited)

If you need/want to characterize floats beyond just being of datatype "double", you can pick ideas from this code:

Local $a = [ _
    [0xfff0000000000000, "-infinity"], _                    ;   1 11111111111 0000000000000000000000000000000000000000000000000000  ⎫
    [0xffefffffffffffff, "smallest negative normal"], _     ;   1 11111111110 1111111111111111111111111111111111111111111111111111  ⎪
    [0x8010000000000000, "largest negative normal"], _      ;   1 00000000001 0000000000000000000000000000000000000000000000000000  ⎪
    [0x8000000000000000, "negative zero"], _                ;   1 00000000000 0000000000000000000000000000000000000000000000000000  ⎪
    [0x0000000000000000, "positive zero"], _                ;   0 00000000000 0000000000000000000000000000000000000000000000000000  ⎬  Numbers you can deal with
    [0x0010000000000000, "smallest positive normal"], _     ;   0 00000000001 0000000000000000000000000000000000000000000000000000  ⎪
    [0x7fefffffffffffff, "largest positive normal"], _      ;   0 11111111110 1111111111111111111111111111111111111111111111111111  ⎪
    [0x7ff0000000000000, "+infinity"], _                    ;   0 11111111111 0000000000000000000000000000000000000000000000000000  ⎭
    [0x800fffffffffffff, "smallest negative denormal"], _   ;   1 00000000000 1111111111111111111111111111111111111111111111111111    ⎫
    [0x8000000000000001, "largest negative denormal"], _    ;   1 00000000000 0000000000000000000000000000000000000000000000000001    ⎬  Numbers best avoided unless
    [0x0000000000000001, "smallest positive denormal"], _   ;   0 00000000000 0000000000000000000000000000000000000000000000000001    ⎪  dealing with extra-small values
    [0x000fffffffffffff, "largest positive denormal"], _    ;   0 00000000000 1111111111111111111111111111111111111111111111111111    ⎭
    [0xfff8000000000001, "-NAN (quiet, denormal)"], _       ;   1 11111111111 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1  ⎫
    [0xfff0000000000001, "-NAN (signaling, denormal)"], _   ;   1 11111111111 00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1  ⎪
    [0xfff4000000000001, "-NAN (signaling, normal)"], _     ;   1 11111111111 0100000000000000000000000000000000000000000000000000         ⎪
    [0x7ff4000000000001, "+NAN (signaling, normal)"], _     ;   0 11111111111 0100000000000000000000000000000000000000000000000000         ⎬  You shouldn't get those
    [0x7ff8000000000001, "+NAN (quiet, denormal)"], _       ;   0 11111111111 1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1  ⎪
    [0x7ff0000000000001, "+NAN (signaling, denormal)"], _   ;   0 11111111111 00xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x >= 1  ⎭
    [0xfff8000000000000, " NAN (indeterminate)"] _          ;   1 11111111111 1000000000000000000000000000000000000000000000000000    ◀  You made a big mistake
]

ConsoleWrite("Ranges of double values" & @LF)

Local $t = DllStructCreate("int64")
Local $u = DllStructCreate("double", DllStructGetPtr($t))
Local $v
For $n = 0 To UBound($a) - 1
    DllStructSetData($t, 1, $a[$n][0])
    $v = DllStructGetData($u, 1)
    ConsoleWrite(StringFormat("%s%23s\t%s\n", VarGetType($v), $v, $a[$n][1]))
Next

ConsoleWrite(@LF & "FP zeroes are signed !" & @LF)

ConsoleWrite(" 0.0 /  3" & @TAB & (0.0 / 3) & @LF)
ConsoleWrite("-0.0 / -3" & @TAB & (-0.0 / -3) & @LF)
ConsoleWrite(" 0.0 / -3" & @TAB & (0.0 / -3) & @LF)
ConsoleWrite("-0.0 /  3" & @TAB & (-0.0 / 3) & @LF)
ConsoleWrite("Yet (hopefully)" & @LF)
ConsoleWrite("0.0 / -3 = 0.0 / 3" & @TAB & (0.0 / -3 = 0.0 / 3) & @LF)
ConsoleWrite("0.0 / -3 = 0" & @TAB & @TAB & (0.0 / 3 = 0) & @LF)

ConsoleWrite(@LF & "Infinities compute (but if you get there, you are stuck!)" & @LF)

ConsoleWrite("3/0" & @TAB & @TAB & (3/0) & @LF)
ConsoleWrite("3/0 + 100" & @TAB & (3/0 + 100) & @LF)
ConsoleWrite("(3/0) / 2" & @TAB & ((3/0) / 2) & @LF)
ConsoleWrite("-3/0" & @TAB & @TAB & (-3/0) & @LF)
ConsoleWrite("-3/0 + 100" & @TAB & (-3/0 + 100) & @LF)
ConsoleWrite("(-3/0) / 2" & @TAB & ((-3/0) / 2) & @LF)
ConsoleWrite("Sqrt(1/0)" & @TAB & Sqrt(1/0) & @LF)
ConsoleWrite("Log(1/0)" & @TAB & Log(1/0) & @LF)
ConsoleWrite("Exp(1/0)" & @TAB & Exp(1/0) & @LF)

ConsoleWrite(@LF & "Indeterminate forms" & @LF)

Local $ind = [ _
    ["0/0", 0/0], _
    ["0*(1/0)", 0*(1/0)], _
    ["0*(-1/0)", 0*(-1/0)], _
    ["(1/0)-(1/0)", (1/0)-(1/0)], _
    ["(-1/0)-(-1/0)", (-1/0)-(-1/0)], _
    ["(1/0)+(-1/0)", (1/0)+(-1/0)], _
    ["(-1/0)+(1/0)", (-1/0)+(1/0)], _
    ["1^(1/0)", 1^(1/0)], _
    ["1^(-1/0)", 1^(-1/0)], _
    ["-1^(1/0)", -1^(1/0)], _
    ["-1^(-1/0)", -1^(-1/0)], _
    ["Cos(1/0)", Cos(1/0)], _
    ["Sin(1/0)", Sin(1/0)], _
    ["ACos(5)", ACos(5)], _
    ["ASin(5)", ASin(5)], _
    ["Sqrt(-1)", Sqrt(-1)], _
    ["Log(-1)", Log(-1)] _
]

For $i = 0 To UBound($ind) - 1
    ConsoleWrite(StringFormat("%-15s\t%s\t%f\n", $ind[$i][0], VarGetType($ind[$i][1]), $ind[$i][1]))
Next

ConsoleWrite(@LF & "NANs never compare !" & @LF)

ConsoleWrite("0/0 > 0" & @TAB & @TAB & (0/0 > 0) & @LF)
ConsoleWrite("0/0 = 0" & @TAB & @TAB & (0/0 = 0) & @LF)
ConsoleWrite("0/0 < 0" & @TAB & @TAB & (0/0 < 0) & @LF)
ConsoleWrite("0/0 > -0/0" & @TAB & (0/0 > -0/0) & @LF)
ConsoleWrite("0/0 = -0/0" & @TAB & (0/0 = -0/0) & @LF)
ConsoleWrite("0/0 < -0/0" & @TAB & (0/0 < -0/0) & @LF)

 

Edited by jchd
Fixed typos in +/- normal signaling NANs 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)

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