Class Doubles

java.lang.Object
com.pnfsoftware.jeb.util.primitives.Doubles

public class Doubles extends Object
Utility methods for double values and IEEE-754 binary64 bit patterns.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    getNaNType(double d)
    Determine the NaN type of a double.
    static int
    getNaNType(long bits)
    Determine the NaN type of a raw fp64 bit pattern.
    static int
    getSpecialType(double d)
    Determine whether a double is finite, infinite, or a NaN.
    static int
    getSpecialType(long bits)
    Determine whether a raw fp64 bit pattern is finite, infinite, or a NaN.
    static boolean
    isQuietNaN(double d)
    Determine whether a double is a quiet NaN.
    static boolean
    isQuietNaN(long bits)
    Determine whether a raw fp64 bit pattern represents a quiet NaN.
    static boolean
    isSignalingNaN(double d)
    Determine whether a double is a signaling NaN.
    static boolean
    isSignalingNaN(long bits)
    Determine whether a raw fp64 bit pattern represents a signaling NaN.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Doubles

      public Doubles()
  • Method Details

    • getSpecialType

      public static int getSpecialType(double d)
      Determine whether a double is finite, infinite, or a NaN.
      Parameters:
      d - an fp64 float
      Returns:
      0=not a NaN; 1=quiet NaN; 2=signaling NaN, 3=infinite
    • getSpecialType

      public static int getSpecialType(long bits)
      Determine whether a raw fp64 bit pattern is finite, infinite, or a NaN.
      Parameters:
      bits - raw bits of an fp64 primitive
      Returns:
      0=not a NaN; 1=quiet NaN; 2=signaling NaN, 3=infinite
    • getNaNType

      public static int getNaNType(double d)
      Determine the NaN type of a double.
      Parameters:
      d - an fp64 float
      Returns:
      0=not a NaN; 1=quiet NaN; 2=signaling NaN
    • getNaNType

      public static int getNaNType(long bits)
      Determine the NaN type of a raw fp64 bit pattern.
      Parameters:
      bits - raw bits of an fp64 primitive
      Returns:
      0=not a NaN; 1=quiet NaN; 2=signaling NaN
    • isQuietNaN

      public static boolean isQuietNaN(double d)
      Determine whether a double is a quiet NaN.
      Parameters:
      d - an fp64 float
      Returns:
      true if the value is a quiet NaN
    • isQuietNaN

      public static boolean isQuietNaN(long bits)
      Determine whether a raw fp64 bit pattern represents a quiet NaN.
      Parameters:
      bits - raw bits of an fp64 primitive
      Returns:
      true if the bit pattern represents a quiet NaN
    • isSignalingNaN

      public static boolean isSignalingNaN(double d)
      Determine whether a double is a signaling NaN.
      Parameters:
      d - an fp64 float
      Returns:
      true if the value is a signaling NaN
    • isSignalingNaN

      public static boolean isSignalingNaN(long bits)
      Determine whether a raw fp64 bit pattern represents a signaling NaN.
      Parameters:
      bits - raw bits of an fp64 primitive
      Returns:
      true if the bit pattern represents a signaling NaN