BitXtoB BitDtoB

BitBtoX


The BitBtoX function converts a binary string representation to a hexadecimal string representation.

Syntax

sHex = BitBtoX( sBinary )

bullet.gif    sHex is a hexadecimal string representation of a number.

bullet.gif    sBinary is the binary string representation of a number.

Remarks

The binary and hexadecimal string representations both have the lowest-order bit at the right end of the string. The function does not care whether the string contains leading zeros for the highest order bits that are not set.

Example

The following script converts a binary string representation to a hexadecimal string representation..

s = "100101"

-- pick a number

sHex = BitBtoX( s )

-- convert to a decimal number

Printf( "'%s binary --> %s Hex'", s, sHex )

-- prints 100101 binary --> 00000025 hex

Related Topics

Boolean Math Functions

BitXtoB

BitBtoD


Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.