MathHelper.subtractExact

Returns the difference of the arguments, throwing an exception if the result overflows an {@code int}.

@param x the first value @param y the second value to subtract from the first @return the result @throws ArithmeticException if the result overflows an int

  1. int subtractExact(int x, int y)
    class MathHelper
    static
    int
    subtractExact
    (
    int x
    ,
    int y
    )
  2. long subtractExact(long x, long y)

Meta