Class Doubles
java.lang.Object
com.pnfsoftware.jeb.util.primitives.Doubles
Utility methods for
double values and IEEE-754 binary64 bit patterns.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetNaNType(double d) Determine the NaN type of a double.static intgetNaNType(long bits) Determine the NaN type of a raw fp64 bit pattern.static intgetSpecialType(double d) Determine whether a double is finite, infinite, or a NaN.static intgetSpecialType(long bits) Determine whether a raw fp64 bit pattern is finite, infinite, or a NaN.static booleanisQuietNaN(double d) Determine whether a double is a quiet NaN.static booleanisQuietNaN(long bits) Determine whether a raw fp64 bit pattern represents a quiet NaN.static booleanisSignalingNaN(double d) Determine whether a double is a signaling NaN.static booleanisSignalingNaN(long bits) Determine whether a raw fp64 bit pattern represents a signaling NaN.
-
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
-