Hex values to dec with AND

M

Magnus Flisberg

Best programmers,

I have two hex values (800A03EA) and (FFFF) and would like to use AND
to get the decimal value 1002. Using windows calculator this is
easy...but what code do I use for either C# or VB.NET? Can't figure it
out and google or google groups can't help me.

Any suggestions?
 
M

Mattias Sjögren

Magnus,
I have two hex values (800A03EA) and (FFFF) and would like to use AND
to get the decimal value 1002. Using windows calculator this is
easy...but what code do I use for either C# or VB.NET? Can't figure it
out and google or google groups can't help me.

C#:

uint i = 0x800A03EA & 0xFFFF;

In VB you use the And operator.


If you have the values as strings, check out the (U)Int32.Parse
method.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top