Package org.sosy_lab.java_smt.api
Class FloatingPointNumber
java.lang.Object
org.sosy_lab.java_smt.api.FloatingPointNumber
Represents a floating-point number with customizable precision, consisting of sign, exponent, and
mantissa components.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecompute a representation as Java-based double value, if possible.floatcompute a representation as Java-based float value, if possible.abstract BigIntegerThe exponent of the floating-point number, given as numeric value.abstract intabstract BigIntegerThe mantissa (aka significand) of the floating-point number, given as numeric value.abstract intabstract booleangetSign()Whether the number is positive (TRUE) or negative (FALSE).static FloatingPointNumberof(boolean sign, BigInteger exponent, BigInteger mantissa, int exponentSize, int mantissaSize) static FloatingPointNumberfinal StringtoString()Return a bit-representation of sign-bit, exponent, and mantissa, i.e., a concatenation of their bit-representations in this exact ordering.
-
Field Details
-
SINGLE_PRECISION_EXPONENT_SIZE
public static final int SINGLE_PRECISION_EXPONENT_SIZE- See Also:
-
SINGLE_PRECISION_MANTISSA_SIZE
public static final int SINGLE_PRECISION_MANTISSA_SIZE- See Also:
-
DOUBLE_PRECISION_EXPONENT_SIZE
public static final int DOUBLE_PRECISION_EXPONENT_SIZE- See Also:
-
DOUBLE_PRECISION_MANTISSA_SIZE
public static final int DOUBLE_PRECISION_MANTISSA_SIZE- See Also:
-
-
Constructor Details
-
FloatingPointNumber
public FloatingPointNumber()
-
-
Method Details
-
getSign
public abstract boolean getSign()Whether the number is positive (TRUE) or negative (FALSE). -
getExponent
The exponent of the floating-point number, given as numeric value. -
getMantissa
The mantissa (aka significand) of the floating-point number, given as numeric value. -
getExponentSize
public abstract int getExponentSize() -
getMantissaSize
public abstract int getMantissaSize() -
of
public static FloatingPointNumber of(boolean sign, BigInteger exponent, BigInteger mantissa, int exponentSize, int mantissaSize) -
of
-
floatValue
public float floatValue()compute a representation as Java-based float value, if possible. -
doubleValue
public double doubleValue()compute a representation as Java-based double value, if possible. -
toString
Return a bit-representation of sign-bit, exponent, and mantissa, i.e., a concatenation of their bit-representations in this exact ordering.
-