@Test(groups="1s", timeOut=60000) public void testDivFloor() throws Exception { Assert.assertEquals(0, MathUtils.divFloor(3,5)); Assert.assertEquals(-1, MathUtils.divFloor(-3,5)); Assert.assertEquals(-1, MathUtils.divFloor(3,-5)); Assert.assertEquals(0, MathUtils.divFloor(-3,-5)); Assert.assertEquals(-1, MathUtils.divFloor(-3,3)); Assert.assertEquals(-1, MathUtils.divFloor(-1,3)); Assert.assertEquals(1, MathUtils.divFloor(3,3)); Assert.assertEquals(Integer.MAX_VALUE, MathUtils.divFloor(10,0)); }
public static int divFloor(int x, int y) { if (y == 0) { return Integer.MAX_VALUE; } else { return Math.floorDiv(x,y); } }
MathUtils { public static int divFloor(int x, int y) { if (y == 0) { return Integer.MAX_VALUE; } else { return Math.floorDiv(x,y); } } }
MathUtils { public static int divFloor(int x, int y) { if (y == 0) { return Integer.MAX_VALUE; } else { return Math.floorDiv(x,y); } } private  MathUtils(); }
MathUtils { public static int divFloor(int x, int y) { if (y == 0) { return Integer.MAX_VALUE; } else { return Math.floorDiv(x,y); } } private  MathUtils(); static long factorial(int n); static int combinaison(int n, int p); static boolean isPowerOfTwo(int x); static int pow(int value, int exp); static double log(double value, double exponent); static double roundedLog(double value, double exponent); static int sum(int[] values, int begin, int end); static int sumFrom(int[] values, int begin); static int sumTo(int[] values, int end); static int sum(int[] values); static int sum(int[][] values); static int max(int[] values); static int max(int[][] values); static int min(int[] values); static int min(int[][] values); static int divFloor(int x, int y); static int divCeil(int x, int y); static int safeAdd(int x, int y); static int safeSubstract(int x, int y); static int safeMultiply(int x, int y); static int safeCast(long x); static double log2(double a); }
MathUtils { public static int divFloor(int x, int y) { if (y == 0) { return Integer.MAX_VALUE; } else { return Math.floorDiv(x,y); } } private  MathUtils(); static long factorial(int n); static int combinaison(int n, int p); static boolean isPowerOfTwo(int x); static int pow(int value, int exp); static double log(double value, double exponent); static double roundedLog(double value, double exponent); static int sum(int[] values, int begin, int end); static int sumFrom(int[] values, int begin); static int sumTo(int[] values, int end); static int sum(int[] values); static int sum(int[][] values); static int max(int[] values); static int max(int[][] values); static int min(int[] values); static int min(int[][] values); static int divFloor(int x, int y); static int divCeil(int x, int y); static int safeAdd(int x, int y); static int safeSubstract(int x, int y); static int safeMultiply(int x, int y); static int safeCast(long x); static double log2(double a); final static double ROUNDED_LOG_PRECISION; final static double LOG10_2; }