BitBtoD


 nThe BitBtoD function converts a binary string representation to a decimal number.

Syntax

nNumber = BitBtoD( sString )

bullet.gif    nNumber is a decimal number.

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

Remarks

The binary representation has the lowest 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 decimal number. Note that the decimal number is printed using %u because it is considered an unsigned (i.e., 0 or positive) integer.

s = "100101"

-- pick a number

n = BitBtoD( s )

-- convert to a decimal number

Printf( "'%s binary --> %u'", s, n )

-- prints 100101 binary --> 37

Related Topics

Boolean Math Functions

BitDtoB

BitBtoX


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