Class IEEE754rUtil

java.lang.Object
com.landawn.abacus.util.IEEE754rUtil

public final class IEEE754rUtil extends Object

Note: it's copied from Apache Commons Lang developed at The Apache Software Foundation (http://www.apache.org/), or under the Apache License 2.0. The methods copied from other products/frameworks may be modified in this class.

Provides IEEE-754r variants of NumberUtils methods.

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

Since:
2.4
Version:
$Id: IEEE754rUtils.java 1436768 2013-01-22 07:07:42Z ggregory $
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    max(double... array)
    Returns the maximum value in an array.
    static double
    max(double a, double b)
    Gets the maximum of two double values.
    static double
    max(double a, double b, double c)
    Gets the maximum of three double values.
    static float
    max(float... array)
    Returns the maximum value in an array.
    static float
    max(float a, float b)
    Gets the maximum of two float values.
    static float
    max(float a, float b, float c)
    Gets the maximum of three float values.
    static double
    min(double... array)
    Returns the minimum value in an array.
    static double
    min(double a, double b)
    Gets the minimum of two double values.
    static double
    min(double a, double b, double c)
    Gets the minimum of three double values.
    static float
    min(float... array)
    Returns the minimum value in an array.
    static float
    min(float a, float b)
    Gets the minimum of two float values.
    static float
    min(float a, float b, float c)
    Gets the minimum of three float values.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • min

      public static float min(float a, float b)

      Gets the minimum of two float values.

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

      Parameters:
      a - value 1
      b - value 2
      Returns:
    • min

      public static float min(float a, float b, float c)

      Gets the minimum of three float values.

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

      Parameters:
      a - value 1
      b - value 2
      c - value 3
      Returns:
    • min

      @SafeVarargs public static float min(float... array)

      Returns the minimum value in an array.

      Parameters:
      array - an array, must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if array is empty
    • min

      public static double min(double a, double b)

      Gets the minimum of two double values.

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

      Parameters:
      a - value 1
      b - value 2
      Returns:
    • min

      public static double min(double a, double b, double c)

      Gets the minimum of three double values.

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

      Parameters:
      a - value 1
      b - value 2
      c - value 3
      Returns:
    • min

      @SafeVarargs public static double min(double... array)

      Returns the minimum value in an array.

      Parameters:
      array - an array, must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if array is empty
    • max

      public static float max(float a, float b)

      Gets the maximum of two float values.

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

      Parameters:
      a - value 1
      b - value 2
      Returns:
    • max

      public static float max(float a, float b, float c)

      Gets the maximum of three float values.

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

      Parameters:
      a - value 1
      b - value 2
      c - value 3
      Returns:
    • max

      @SafeVarargs public static float max(float... array)

      Returns the maximum value in an array.

      Parameters:
      array - an array, must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if array is empty
    • max

      public static double max(double a, double b)

      Gets the maximum of two double values.

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

      Parameters:
      a - value 1
      b - value 2
      Returns:
    • max

      public static double max(double a, double b, double c)

      Gets the maximum of three double values.

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

      Parameters:
      a - value 1
      b - value 2
      c - value 3
      Returns:
    • max

      @SafeVarargs public static double max(double... array)

      Returns the maximum value in an array.

      Parameters:
      array - an array, must not be null or empty
      Returns:
      Throws:
      IllegalArgumentException - if array is empty