equal
deleted
inserted
replaced
363 * Internal method to share logic between floor and ceil. |
363 * Internal method to share logic between floor and ceil. |
364 * |
364 * |
365 * @param a the value to be floored or ceiled |
365 * @param a the value to be floored or ceiled |
366 * @param negativeBoundary result for values in (-1, 0) |
366 * @param negativeBoundary result for values in (-1, 0) |
367 * @param positiveBoundary result for values in (0, 1) |
367 * @param positiveBoundary result for values in (0, 1) |
368 * @param increment value to add when the argument is non-integral |
368 * @param sign the sign of the result |
369 */ |
369 */ |
370 private static double floorOrCeil(double a, |
370 private static double floorOrCeil(double a, |
371 double negativeBoundary, |
371 double negativeBoundary, |
372 double positiveBoundary, |
372 double positiveBoundary, |
373 double sign) { |
373 double sign) { |
809 * throwing an exception if the value overflows an {@code int}. |
809 * throwing an exception if the value overflows an {@code int}. |
810 * |
810 * |
811 * @param value the long value |
811 * @param value the long value |
812 * @return the argument as an int |
812 * @return the argument as an int |
813 * @throws ArithmeticException if the {@code argument} overflows an int |
813 * @throws ArithmeticException if the {@code argument} overflows an int |
814 * @see Math#toIntExact(int) |
814 * @see Math#toIntExact(long) |
815 * @since 1.8 |
815 * @since 1.8 |
816 */ |
816 */ |
817 public static int toIntExact(long value) { |
817 public static int toIntExact(long value) { |
818 return Math.toIntExact(value); |
818 return Math.toIntExact(value); |
819 } |
819 } |