A Gathering of Small Number Systems Conversions and Operations for WP7
I know its not too much but I gathered about 16 number-conversion operations and few logical operators in a small DLL for Windows Phone devs who might need it. The functions are:
|
1 |
Public Shared Function Dec2BinStr(ByVal Dec As Long) As String |
Converts a decimal number into a binary number in the form of stringĀ (ex: 10 becomes “1010″)
|
1 |
Public Shared Function Dec2BinAry(ByVal Dec As Long) As Integer() |
Converts a decimal number into a binary number in the form of an array of ones and zeros.
|
1 |
Public Shared Function BinStr2Dec(ByVal Bin As String) As Long |
Converts a binary number in the form of a string into a decimal number.
|
1 |
Public Shared Function BinAry2Dec(ByVal Bin() As Integer) As Long |
Converts a binary array into a decimal number.
|
1 |
Public Shared Function HexStr2Dec(ByVal Hex As String) As Long |
Converts a hexadecimal number int he form of a string into a decimal number.
|
1 |
Public Shared Function Dec2HexStr(ByVal Dec As Long) As String |
Converts decimal number into a hexadecimal number in the form of string.
|
1 |
Public Shared Function HexStr2BinStr(ByVal Hex As String) As String |
Converts a hexadecimal number in the form of a string into a binary number, also in the form of string.
|
1 |
Public Function BinStr2HexStr(ByVal Bin As String) As String |
Converts a binary number in the form of a string into a hexadecimal number, also in the form of string.
|
1 |
Public Function BinStrAnd(ByVal Bin1 As String, ByVal Bin2 As String) As String |
Perform bitwise AND operation between two binary numbers in the form of a string.
|
1 |
Public Function HexStrAnd(ByVal Hex1 As String, ByVal Hex2 As String) As String |
Perform bitwise and between two hexadecimal numbers in the form of a string.
|
1 |
Public Function BinStrOr(ByVal Bin1 As String, ByVal Bin2 As String) As String |
Perform bitwise OR operation between two binary numbers in the form of a string.
|
1 |
Public Function HexStrOr(ByVal Hex1 As String, ByVal Hex2 As String) As String |
Perform bitwise OR operation between two hexadecimal numbers in the form of a string.
|
1 |
Public Function BinStrXOR(ByVal Bin1 As String, ByVal Bin2 As String) As String |
Perform bitwise XOR operation between two binary numbers in the form of a string.
|
1 |
Public Function HexStrXOR(ByVal Hex1 As String, ByVal Hex2 As String) As String |
Perform bitwise XOR operation between two hexadecimal numbers in the form of a string.
|
1 |
Public Function BinStrNot(ByVal Bin As String) As String |
Perform bitwise NOT operation to a binary number in the form of a string.
|
1 |
Public Function HexStrNot(ByVal Bin As String) As String |
Perform bitwise NOT operation to a hexadecimal number in the form of a string.
Here is the download link:
NumberSystem.DLL v1.0 (10 kbytes)
If you have a suggestion to expand this library, please write it down in the comments or tweet it to me, and I’ll try to include it.