Jump to content

Search the Community

Showing results for tags 'Dec'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 3 results

  1. For some reason, I can't convert to Hex a Decimal color that has been calculated. For example, this works: Local $iColor = 3310546 ConsoleWrite("$iColor (dec): " & $iColor & ", $iColor (hex): " & Hex($iColor, 6) & @CRLF) giving the expected output: $iColor (dec): 3310546, $iColor (hex): 3283D2 But if I want to take an average of several colors, I have a problem. For example this doesn't work: $iColor = (3310546 + 3310546) / 2 ConsoleWrite("$iColor (dec): " & $iColor & ", $iColor (hex): " & Hex($iColor, 6) & @CRLF) giving the wrong output: $iColor (dec): 3310546, $iColor (hex): 000000 I observe this behavior after any processing of a decimal color. Is this a bug?
  2. Hi All, Trying to convert a number to binary zeros and ones but I'm getting a result I don't understand and looks more like hex than binary. Here's my basic code: $myNum = 11 $myNumBin = Binary($myNum) MsgBox(0, "Binary result", $myNumBin) What I want is "1011", what I get is 0x0B000000. Thanks!
  3. Seems like Int function works incorrect sometimes. Int of binary data works fine on 1-byte data only. 2+ byte data always returns incorrect results. Int of 4-byte binary data and it's string representation: Int of 4-byte binary data returns bswap as result. Int64 of string representation of 4-byte binary data returns 32-bit signed integer. $bin = Binary('0xff'); 1 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd8'); 2 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d'); 3 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8a'); 4 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abc'); 5 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abcd1'); 6 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abcd1e5'); 7 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) $bin = Binary('0xffd88d8abcd1e5ff'); 8 BYTES MsgBox(524288, BinaryLen($bin) & ' ' & VarGetType($bin) & ' bytes', 'HEX: ' & $bin & @LF & 'Int: ' & Int($bin) & @LF & 'Int32 <- String: ' & Int(String($bin), 1) & @LF & 'Int (auto) <- String: ' & Int(String($bin)) & @LF & 'Int64 <- String: ' & Int(String($bin), 2)) AutoIt 3.3.12.0 x86 and x64 OS: Win 7 x64 SP1
×
×
  • Create New...