Java Number Negate negative(int b)

Here you can find the source of negative(int b)

Description

Constant-time determine if byte is negative.

License

Creative Commons License

Parameter

Parameter Description
b the byte to check.

Return

1 if the byte is negative, 0 otherwise.

Declaration

public static int negative(int b) 

Method Source Code

//package com.java2s;

public class Main {
    /**//  w  w w  .  j  a va2  s  .  c  o m
     * Constant-time determine if byte is negative.
     *
     * @param b the byte to check.
     * @return 1 if the byte is negative, 0 otherwise.
     */
    public static int negative(int b) {
        return (b >> 8) & 1;
    }
}

Related

  1. negateExact(double a)
  2. negateExpression(String expression)
  3. negateInPlace(float[] in)
  4. Negation(String StartIP, String netmask)
  5. negative(float a)
  6. negative(Number n)
  7. negativeInf()
  8. negativePart(final double[] data)
  9. negativeStatistics(double[] array)