Jump to content

What does AutoIT consider binary number?


Trax
 Share

Recommended Posts

I always thought a binary number was a string of zeros and ones like "01001100" but I must be missing something. Binary() and BinaryToString() don't convert it to what I consider a Binary. What does AutoIT consider to be a Binary number?

My ultimate goal is to convert a hex like BFA0D1 to a bit string like 010001101, Is there a function that will do that? 

Link to comment
Share on other sites

There are various functions on the forum to convert numbers to binary (base 2)
among others you can use _BaseToBase() by @czardas that allows you to convert from/to various bases bidirectionally
That function is included in his math10.au3 udf you can find here: https://www.autoitscript.com/forum/topic/150224-udf-suite/

#include <math10.au3> ; <--- get this udf here: https://www.autoitscript.com/forum/topic/150224-udf-suite/

ConsoleWrite(_BaseToBase("BFA0D1", 16, 2) & @CRLF) ; from base 16 to base 2
ConsoleWrite(_BaseToBase('101111111010000011010001', 2, 16) & @CRLF) ; from base 2 to base 16

 

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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