Jump to content

Division followed by BinaryString conversion returns incorrect values


Recommended Posts

I'm getting the wrong result when I convert equations involving division to BinaryStrings (also with multiplication by numbers less than 1, which I guess AutoIt handles the same way). :lmao: Multiplication by numbers greater than (or equal to) 1, as well as any addition or subtraction, don't cause this. I'm using version 3.2.0.1.

$Num1 = 500
$Num2 = 1000 / 2
;~ $Num2 = 1000 * 0.5

$Num1_Bin = String (BinaryString ($Num1))
$Num2_Bin = String (BinaryString ($Num2))

MsgBox (0, "Test", "Num1: " & $Num1 & @CRLF & "Num2: " & $Num2 & @CRLF & "Num1_Bin: " & $Num1_Bin & @CRLF & "Num2_Bin: " & $Num2_Bin)oÝ÷ Ø-6é¶z«¶*'rïz»"¢{+zÛ«Ø^±©­ë.Ü!Èb²}ý¶Ø^±©jËa{Mú6éµrïz»"¢sn^tÐÛ¦Û46éµ)ôÄ^4×M4ÐۦاÓ4ÓM4ÓM4ãNÅã@&"h¬²)ಶ§¨táÌ(®K±¬(®F«¢éÝjÙ^jËZºÚ"µÍÌÍÓ[LH[X
Ý[È
    ÌÍÓ[LJ
Edited by ChiDragon
Link to comment
Share on other sites

  • Moderators

What about $Num2 = Int(1000 / 2) what does that do?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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