MathHelper.subtractExact

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

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

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

Meta