Package org.apache.commons.lang3.math
Class IEEE754rUtils
java.lang.Object
org.apache.commons.lang3.math.IEEE754rUtils
Provides IEEE-754r variants of NumberUtils methods.
- Since:
- 2.4
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic double
max
(double... array) Returns the maximum value in an array.static double
max
(double a, double b) Gets the maximum of twodouble
values.static double
max
(double a, double b, double c) Gets the maximum of threedouble
values.static float
max
(float... array) Returns the maximum value in an array.static float
max
(float a, float b) Gets the maximum of twofloat
values.static float
max
(float a, float b, float c) Gets the maximum of threefloat
values.static double
min
(double... array) Returns the minimum value in an array.static double
min
(double a, double b) Gets the minimum of twodouble
values.static double
min
(double a, double b, double c) Gets the minimum of threedouble
values.static float
min
(float... array) Returns the minimum value in an array.static float
min
(float a, float b) Gets the minimum of twofloat
values.static float
min
(float a, float b, float c) Gets the minimum of threefloat
values.
-
Constructor Details
-
IEEE754rUtils
Deprecated.TODO Make private in 4.0.Make private in 4.0.
-
-
Method Details
-
max
Returns the maximum value in an array.- Parameters:
array
- an array, must not be null or empty- Returns:
- the minimum value in the array
- Throws:
NullPointerException
- ifarray
isnull
IllegalArgumentException
- ifarray
is empty- Since:
- 3.4 Changed signature from max(double[]) to max(double...)
-
max
Gets the maximum of twodouble
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2- Returns:
- the largest of the values
-
max
Gets the maximum of threedouble
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2c
- value 3- Returns:
- the largest of the values
-
max
Returns the maximum value in an array.- Parameters:
array
- an array, must not be null or empty- Returns:
- the minimum value in the array
- Throws:
NullPointerException
- ifarray
isnull
IllegalArgumentException
- ifarray
is empty- Since:
- 3.4 Changed signature from max(float[]) to max(float...)
-
max
Gets the maximum of twofloat
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2- Returns:
- the largest of the values
-
max
Gets the maximum of threefloat
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2c
- value 3- Returns:
- the largest of the values
-
min
Returns the minimum value in an array.- Parameters:
array
- an array, must not be null or empty- Returns:
- the minimum value in the array
- Throws:
NullPointerException
- ifarray
isnull
IllegalArgumentException
- ifarray
is empty- Since:
- 3.4 Changed signature from min(double[]) to min(double...)
-
min
Gets the minimum of twodouble
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2- Returns:
- the smallest of the values
-
min
Gets the minimum of threedouble
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2c
- value 3- Returns:
- the smallest of the values
-
min
Returns the minimum value in an array.- Parameters:
array
- an array, must not be null or empty- Returns:
- the minimum value in the array
- Throws:
NullPointerException
- ifarray
isnull
IllegalArgumentException
- ifarray
is empty- Since:
- 3.4 Changed signature from min(float[]) to min(float...)
-
min
Gets the minimum of twofloat
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2- Returns:
- the smallest of the values
-
min
Gets the minimum of threefloat
values.NaN is only returned if all numbers are NaN as per IEEE-754r.
- Parameters:
a
- value 1b
- value 2c
- value 3- Returns:
- the smallest of the values
-