List of usage examples for java.lang Integer divideUnsigned
public static int divideUnsigned(int dividend, int divisor)
From source file:Main.java
public static void main(String[] args) { // Two negative integer values int x = -1;/*from w w w.j a v a2 s . c om*/ int y = -2; // Performs signed division System.out.println("Signed x = " + x); System.out.println("Signed y = " + y); System.out.println("Signed x/y = " + (x / y)); // Performs unsigned division by treating x and y holding unsigned values long ux = Integer.toUnsignedLong(x); long uy = Integer.toUnsignedLong(y); int uQuotient = Integer.divideUnsigned(x, y); System.out.println("Unsigned x = " + ux); System.out.println("Unsigned y = " + uy); System.out.println("Unsigned x/y = " + uQuotient); }
From source file:com.amazon.janusgraph.diskstorage.dynamodb.DynamoDBDelegate.java
public static final int computeWcu(int bytes) { return Math.max(1, Integer.divideUnsigned(bytes, ONE_KILOBYTE)); }