MathHelper.addExact

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

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

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

Meta