Jump to content

jchd

MVPs
  • Posts

    9,892
  • Joined

  • Last visited

  • Days Won

    114

jchd last won the day on May 17

jchd had the most liked content!

6 Followers

About jchd

  • Birthday 12/22/1954

Profile Information

  • Member Title
    Infinitely drawing infinity
  • Location
    South of France

Recent Profile Visitors

5,158 profile views

jchd's Achievements

  1. Regexes can save your a$$ everyday!
  2. You're perfectly right. Relevant neurons fixed!
  3. Wrong, the Bool datatype is clearly part of the language. Untrue as well. Perseverare diabolicum.
  4. That's plain wrong. Please reconsider! Local $v = 1=1 ConsoleWrite(VarGetType($v) & @LF)
  5. Indeed, all these buggy @DOUBLE_WS make this table terribly hard to read. Even copy-pasting the table content to a text editor and replacing @DOUBLE_WS by a couple of spaces doesn't align the columns. I confess being responsible for going deep into (*UCP) details in StringRegEx help (beside having authored the bulk of that help topic) but since we DO have AutoIt users handling cyrillic, greek, asian languages and others, I found it useful to mention everything of value for all users.
  6. No, its a small greek letter phi (φ). I was also surprised it existed. Got that source from @Nine (above) but didn't correctly check. Code fixed.
  7. I'm always satisfied (I have close to zero use of AutoIt myself)! It's not for me, I did just clear up some dark corners in case you would be interested.
  8. For even more fun, here are more symbols and also indices available: Func _Exponent($s) Local Static $sInp = "()+-0123456789=AÆBDEƎGHIJKLMNOPRTUWabcdefghijklmnoprstuvwxyz" Local Static $sExp = "⁽⁾⁺⁻⁰¹²³⁴⁵⁶⁷⁸⁹⁼ᴬᴭᴮᴰᴱᴲᴳᴴᴵᴶᴷᴸᴹᴺᴼᴾᴿᵀᵁᵂᵃᵇᶜᵈᵉᶠᵍʰⁱʲᵏˡᵐⁿᵒᵖʳˢᵗᵘᵛʷˣʸᶻ" Local Static $mExp[] If UBound($mExp) = 0 Then For $i = 1 To StringLen($sInp) $mExp[StringMid($sInp, $i, 1)] = StringMid($sExp, $i, 1) Next EndIf Local $c For $i = 1 To StringLen($s) $c = StringMid($s, $i, 1) If MapExists($mExp, $c) Then $s = StringReplace($s, $c, $mExp[$c]) Next Return($s) EndFunc ;==>_Exponent Func _Indice($s) Local Static $sInp = "()+-0123456789=aehijklmnoprstuvx" Local Static $sInd = "₍₎₊₋₀₁₂₃₄₅₆₇₈₉₌ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓ" Local Static $mInd[] If UBound($mInd) = 0 Then For $i = 1 To StringLen($sInp) $mInd[StringMid($sInp, $i, 1)] = StringMid($sInd, $i, 1) Next EndIf Local $c For $i = 1 To StringLen($s) $c = StringMid($s, $i, 1) If MapExists($mInd, $c) Then $s = StringReplace($s, $c, $mInd[$c]) Next Return($s) EndFunc ;==>_Indice
  9. Which part(s) do you feel strange?
  10. Added more (all?) cases of infinities, indeterminates and clarified NANs (Not A Number) categories.
  11. 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/3" & @TAB & (0/3) & @LF) ConsoleWrite("-0/-3" & @TAB & (-0/-3) & @LF) ConsoleWrite(" 0/-3" & @TAB & (0/-3) & @LF) ConsoleWrite("-0/3" & @TAB & (-0/3) & @LF) ConsoleWrite("Yet (hopefully)" & @LF) ConsoleWrite("0/-3 = 0/3" & @TAB & (0/-3 = 0/3) & @LF) ConsoleWrite("0/-3 = 0" & @TAB & (0/3 = 0) & @LF) ConsoleWrite(@LF & "Infinities compute (but if you get there, you are mostly stuck!)" & @LF) Local Const $PI = 3.141592653589793 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) ^ 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("(-3/0) ^ 2" & @TAB & ((-3/0) ^ 2) & @LF) ConsoleWrite("(-3/0) ^ 5" & @TAB & ((-3/0) ^ 5) & @LF) ConsoleWrite("Log(1/0)" & @TAB & Log(1/0) & @LF) ConsoleWrite("Exp(1/0)" & @TAB & Exp(1/0) & @LF) ConsoleWrite("Tan($Pi/2)" & @TAB & Tan($Pi/2) & @TAB & "<-- should be 'inf'" & @LF) ConsoleWrite("Tan(-$Pi/2)" & @TAB & Tan(-$Pi/2) & @TAB & "<-- should be '-inf'" & @LF) ConsoleWrite("ATan(1/0)" & @TAB & ATan(1/0) & @TAB & @TAB & "<-- Pi/2" & @LF) ConsoleWrite("ATan(-1/0)" & @TAB & ATan(-1/0) & @TAB & "<-- -Pi/2" & @LF) ConsoleWrite("1/(1/0)" & @TAB & @TAB & 1/(1/0) & @LF) ConsoleWrite("-1/(1/0)" & @TAB & -1/(1/0) & @LF) ConsoleWrite("1/(-1/0)" & @TAB & 1/(-1/0) & @LF) ConsoleWrite("-1/(-1/0)" & @TAB & -1/(-1/0) & @LF) ConsoleWrite("0^0)" & @TAB & @TAB & 0^0 & @TAB & @TAB & @TAB & "<-- NOT indeterminate in FP" & @LF) ConsoleWrite("(1/0)^0" & @TAB & @TAB & (1/0)^0 & @TAB & @TAB & @TAB & "<-- NOT indeterminate in FP" & @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)
  12. You can add 3 AutoIt types: Keyword, Function and UserFunction. Also you can differentiate between Int32, Int64, Double and float signals.
  13. Thanks. Nitpick: if hours is a single digit, a preceding space is eaten. I seem to recall that H, M & S format is 2 digit in all cases. "2025-08-07 0:0:0" returns "2025-08-0712:0:0 AM" but should probably be "2025-08-07 12:00:00 AM" Not that I use AM/PM ridiculous convention. 24h format, like metric units, should be mandatory everywhere.
  14. If you dump the object you get, you can see it isn't an array: Object Name: SWbemObjectSet Description: A collection of Classes or Instances Associated file: C:\Windows\SysWOW64\wbem\wbemdisp.TLB Owner/marshaller: C:\WINDOWS\system32\wbem\wbemdisp.dll CLSID: {04B83D61-21AE-11D2-8B33-00600806D9B6} InterfaceID: {76A6415F-CB41-11D1-8B02-00600806D9B6} From AutoIt point of view, this is a flat variable, so UBound returns 0.
×
×
  • Create New...