Package org.eclipse.jetty.util
Class MathUtils
- java.lang.Object
-
- org.eclipse.jetty.util.MathUtils
-
@Deprecated(since="2021-05-27") public class MathUtils extends java.lang.Object
Deprecated.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static int
cappedAdd(int a, int b, int maxValue)
Deprecated.Returns the sum of its arguments, capping tomaxValue
.static long
cappedAdd(long a, long b)
Deprecated.Returns the sum of its arguments, capping toLong.MAX_VALUE
if they overflow.static boolean
sumOverflows(int a, int b)
Deprecated.Returns whether the sum of the arguments overflows anint
.
-
-
-
Method Detail
-
sumOverflows
public static boolean sumOverflows(int a, int b)
Deprecated.Returns whether the sum of the arguments overflows anint
.- Parameters:
a
- the first valueb
- the second value- Returns:
- whether the sum of the arguments overflows an
int
-
cappedAdd
public static long cappedAdd(long a, long b)
Deprecated.Returns the sum of its arguments, capping toLong.MAX_VALUE
if they overflow.- Parameters:
a
- the first valueb
- the second value- Returns:
- the sum of the values, capped to
Long.MAX_VALUE
-
cappedAdd
public static int cappedAdd(int a, int b, int maxValue)
Deprecated.Returns the sum of its arguments, capping tomaxValue
.- Parameters:
a
- the first valueb
- the second value- Returns:
- the sum of the values, capped to
maxValue
-
-