java mask int to positive

Solutions on MaxInterview for java mask int to positive by the best coders in the world

showing results for - "java mask int to positive"
Caprice
11 Jan 2021
1int abs(int v) {
2    int mask = v >> Integer.SIZE - 1;
3
4    return v + mask ^ mask;
5}
6
similar questions
queries leading to this page
java mask int to positive