numbersystem.dll

A Gathering of Small Number Systems Conversions and Operations for WP7

* UPDATE: I have found many bugs and issues with this original code of this library. For an expanded (and working version) you can look at WP7NC.

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:

Converts a decimal number into a binary number in the form of stringĀ  (ex: 10 becomes “1010”)

Converts a decimal number into a binary number in the form of an array of ones and zeros.

Converts a binary number in the form of a string into a decimal number.

Converts a binary array into a decimal number.

Converts a hexadecimal number int he form of a string into a decimal number.

Converts decimal number into a hexadecimal number in the form of string.

Converts a hexadecimal number in the form of a string into a binary number, also in the form of string.

Converts a binary number in the form of a string into a hexadecimal number, also in the form of string.

Perform bitwise AND operation between two binary numbers in the form of a string.

Perform bitwise and between two hexadecimal numbers in the form of a string.

Perform bitwise OR operation between two binary numbers in the form of a string.

Perform bitwise OR operation between two hexadecimal numbers in the form of a string.

Perform bitwise XOR operation between two binary numbers in the form of a string.

Perform bitwise XOR operation between two hexadecimal numbers in the form of a string.

Perform bitwise NOT operation to a binary number in the form of a string.

Perform bitwise NOT operation to a hexadecimal number in the form of a string.

* UPDATE 02-12-2012: I have found out many minor mistakes in some of the conversion function. Thus, I have removed the file and re-written the library as an open-source project. More details can be found here.

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.