Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef unsigned char u8;
- typedef unsigned short u16;
- struct u4
- {
- u8 zero : 4;
- u8 value : 4;
- u4(){}
- u4(u8 _value) {
- zero = 0;
- value = _value;
- }
- const u4 operator+(const u4& b) { return value + b.value; }
- u4 operator+=(const u4& b) { return value + b.value; }
- bool operator==(const u4& b) { return value == b.value; }
- int check_overflow(u8 operand) const { return operand > (0xf - value) ? 1 : 0; }
- };
Add Comment
Please, Sign In to add comment