java mask int to positive
int abs(int v) {
int mask = v >> Integer.SIZE - 1;
return v + mask ^ mask;
}
Are there any code examples left?
New code examples in category Java
int abs(int v) {
int mask = v >> Integer.SIZE - 1;
return v + mask ^ mask;
}