Answers for "java mask int to positive"

0

java mask int to positive

int abs(int v) {
    int mask = v >> Integer.SIZE - 1;

    return v + mask ^ mask;
}
Posted by: Guest on January-22-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language