Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FUNCky - <b>name:</b> <b>bin2num() - convert 16/8 bit binary string to integer</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Name:     bin2num() - convert 16/8 bit binary string to integer
  Usage:    <integer> = bin2num(<binstr>)
  Params:   string <binstr> - a string of 16 or 8 ones and zeros
            that form a binary byte or word.

            A binary string has the format where a "1" signifies
            that the bit is on, and "0" signifies bit is off:

                 "0001110000111100" or "00111001"

  Returns:  An integer equal to the decimal value of the binary
            string that was sent.

 ---------------------------------- Example ---------------------------------

                 ? bin2num("0000000010000001")
                 * prints 129

                 ? bin2num("00000110")
                 * prints 6

                 ? bin2num("1111111111111111")
                 * prints 65535


See Also: hex2dec() dec2hex() num2bin() byte2bin()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson