Top Description Constructors Methods
org.apache.commons.lang3.math

public Class IEEE754rUtils

extends Object
Class Inheritance
Imports
java.util.Objects, org.apache.commons.lang3.Validate

Provides IEEE-754r variants of NumberUtils methods.

See: https://en.wikipedia.org/wiki/IEEE_754r

Since
2.4

Constructor Summary

AccessConstructor and Description
public
IEEE754rUtils()
Deprecated TODO Make private in 4.0.

Make private in 4.0.

Method Summary

Modifier and TypeMethod and Description
public static double

Returns:

the minimum value in the array.
max
(final double...
an array, must not be null or empty.
array
)

Returns the maximum value in an array.

public static double

Returns:

the largest of the values.
max
(final double
value 1.
a
,
final double
value 2.
b
)

Gets the maximum of two double values.

public static double

Returns:

the largest of the values.
max
(final double
value 1.
a
,
final double
value 2.
b
,
final double
value 3.
c
)

Gets the maximum of three double values.

public static float

Returns:

the minimum value in the array.
max
(final float...
an array, must not be null or empty.
array
)

Returns the maximum value in an array.

public static float

Returns:

the largest of the values.
max
(final float
value 1.
a
,
final float
value 2.
b
)

Gets the maximum of two float values.

public static float

Returns:

the largest of the values.
max
(final float
value 1.
a
,
final float
value 2.
b
,
final float
value 3.
c
)

Gets the maximum of three float values.

public static double

Returns:

the minimum value in the array.
min
(final double...
an array, must not be null or empty.
array
)

Returns the minimum value in an array.

public static double

Returns:

the smallest of the values.
min
(final double
value 1.
a
,
final double
value 2.
b
)

Gets the minimum of two double values.

public static double

Returns:

the smallest of the values
min
(final double
value 1
a
,
final double
value 2
b
,
final double
value 3
c
)

Gets the minimum of three double values.

public static float

Returns:

the minimum value in the array.
min
(final float...
an array, must not be null or empty.
array
)

Returns the minimum value in an array.

public static float

Returns:

the smallest of the values.
min
(final float
value 1.
a
,
final float
value 2.
b
)

Gets the minimum of two float values.

public static float

Returns:

the smallest of the values.
min
(final float
value 1.
a
,
final float
value 2.
b
,
final float
value 3.
c
)

Gets the minimum of three float values.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

IEEE754rUtilsback to summary
public IEEE754rUtils()

Deprecated

TODO Make private in 4.0.

Make private in 4.0.

Annotations
@Deprecated

Method Detail

maxback to summary
public static double max(final double... array)

Returns the maximum value in an array.

Parameters
array:double[]

an array, must not be null or empty.

Returns:double

the minimum value in the array.

Exceptions
NullPointerException:
if array is null.
IllegalArgumentException:
if array is empty.
Since
3.4 Changed signature from max(double[]) to max(double...)
maxback to summary
public static double max(final double a, final double b)

Gets the maximum of two double values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:double

value 1.

b:double

value 2.

Returns:double

the largest of the values.

maxback to summary
public static double max(final double a, final double b, final double c)

Gets the maximum of three double values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:double

value 1.

b:double

value 2.

c:double

value 3.

Returns:double

the largest of the values.

maxback to summary
public static float max(final float... array)

Returns the maximum value in an array.

Parameters
array:float[]

an array, must not be null or empty.

Returns:float

the minimum value in the array.

Exceptions
NullPointerException:
if array is null.
IllegalArgumentException:
if array is empty.
Since
3.4 Changed signature from max(float[]) to max(float...)
maxback to summary
public static float max(final float a, final float b)

Gets the maximum of two float values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:float

value 1.

b:float

value 2.

Returns:float

the largest of the values.

maxback to summary
public static float max(final float a, final float b, final float c)

Gets the maximum of three float values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:float

value 1.

b:float

value 2.

c:float

value 3.

Returns:float

the largest of the values.

minback to summary
public static double min(final double... array)

Returns the minimum value in an array.

Parameters
array:double[]

an array, must not be null or empty.

Returns:double

the minimum value in the array.

Exceptions
NullPointerException:
if array is null.
IllegalArgumentException:
if array is empty.
Since
3.4 Changed signature from min(double[]) to min(double...).
minback to summary
public static double min(final double a, final double b)

Gets the minimum of two double values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:double

value 1.

b:double

value 2.

Returns:double

the smallest of the values.

minback to summary
public static double min(final double a, final double b, final double c)

Gets the minimum of three double values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:double

value 1

b:double

value 2

c:double

value 3

Returns:double

the smallest of the values

minback to summary
public static float min(final float... array)

Returns the minimum value in an array.

Parameters
array:float[]

an array, must not be null or empty.

Returns:float

the minimum value in the array.

Exceptions
NullPointerException:
if array is null.
IllegalArgumentException:
if array is empty.
Since
3.4 Changed signature from min(float[]) to min(float...).
minback to summary
public static float min(final float a, final float b)

Gets the minimum of two float values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:float

value 1.

b:float

value 2.

Returns:float

the smallest of the values.

minback to summary
public static float min(final float a, final float b, final float c)

Gets the minimum of three float values.

NaN is only returned if all numbers are NaN as per IEEE-754r.

Parameters
a:float

value 1.

b:float

value 2.

c:float

value 3.

Returns:float

the smallest of the values.