To work with hexadecimal numbers, just add 0x
in front of the number, like this:
var numeroHexa = 0xff1120;
The same goes for octal numbers, adding 0
:
var numeroOct = 037;
But how do you declare binary numbers?
var numeroBin = ??00101
I'm going to use this to improve the calculations with bitwise operators, my intention is to avoid commenting on the binary value of each enum:
public enum Direction
{
None = 0, //0000
Left = 1, //0001
Right = 2, //0010
Up = 4, //0100
Down = 8, //1000
}
And instead declare each value directly
public enum Direction
{
None = ??0000
Left = ??0001
Right = ??0010
Up = ??0100
Down = ??1000
}