- Joined
- Jul 10, 2007
- Messages
- 6,306
I am forced to do this
And I love lack of typecast
Respond to this post and help get Blizzard to add >>> operator
http://us.battle.net/sc2/en/forum/topic/9423382586
edit
nvm, >>> is a Java thing, not a C thing, but there is still a srl operator D;, and Galaxy doesn't support typecasting and only has signed, so they should really add a >>> cuz it's very annoying to do it otherwise.
Code:
int logicalRightShiftInt(int x, int n) {
return (x & 0x7fffffff) >> n | -((x & 1 << 31) >> n);
}
And I love lack of typecast
Code:
static const byte H_1 = 1;
static const byte H_7F = 0x7f;
static const byte H_80 = 0x80;
byte logicalRightShiftByte(byte x, byte n) {
return (x & H_7F) >> n | (~((x & H_80) >> n) + H_1);
}
Respond to this post and help get Blizzard to add >>> operator
http://us.battle.net/sc2/en/forum/topic/9423382586
edit
nvm, >>> is a Java thing, not a C thing, but there is still a srl operator D;, and Galaxy doesn't support typecasting and only has signed, so they should really add a >>> cuz it's very annoying to do it otherwise.
Last edited: