Greetings,
Thanks for helping me with some of the C# bit manipulation issues I've asked
about over the last couple days. I've got a first public preview of the
Binary8, Binary16, Binary32, and Binary64 classes I've worked on.
Use it like you would any other int, short, byte, whatever... I've
overloaded all but one of the operators (^ -- don't know how to do so).
Examples,
Binary8 bin = "10110100";
Binary16 bin = "1101";
Binary8 bin2 = bin << 3;
Binary64 bin3 = "10101";
Binary8 bin4 = bin3; // accepable because it doesn't exceed 8 bits
Binary8 bin = 0xFF;
Binary16 bin2 = ~bin;
if (bin > bin2) {
bin >>= 7;
}
bin2 = bin.RoateLeft(3 );
if (bin2 != bin) {
bin2 = bin;
}
bin++;
bin *= "0101";
you get the picture...
optimizations wanted. There will be more updates, this is just a preview...
Thanks,
Shawn
Thanks for helping me with some of the C# bit manipulation issues I've asked
about over the last couple days. I've got a first public preview of the
Binary8, Binary16, Binary32, and Binary64 classes I've worked on.
Use it like you would any other int, short, byte, whatever... I've
overloaded all but one of the operators (^ -- don't know how to do so).
Examples,
Binary8 bin = "10110100";
Binary16 bin = "1101";
Binary8 bin2 = bin << 3;
Binary64 bin3 = "10101";
Binary8 bin4 = bin3; // accepable because it doesn't exceed 8 bits
Binary8 bin = 0xFF;
Binary16 bin2 = ~bin;
if (bin > bin2) {
bin >>= 7;
}
bin2 = bin.RoateLeft(3 );
if (bin2 != bin) {
bin2 = bin;
}
bin++;
bin *= "0101";
you get the picture...
optimizations wanted. There will be more updates, this is just a preview...
Thanks,
Shawn
Comment