Class FloatFormat


  • public class FloatFormat
    extends java.lang.Object
    • Field Detail

      • BIG_NaN

        public static final java.math.BigDecimal BIG_NaN
      • BIG_POSITIVE_INFINITY

        public static final java.math.BigDecimal BIG_POSITIVE_INFINITY
      • BIG_NEGATIVE_INFINITY

        public static final java.math.BigDecimal BIG_NEGATIVE_INFINITY
      • maxValue MODIFIED

        type: BigDecimal → BigFloat
        -java.math.BigDecimal maxValue
        +ghidra.pcode.floatformat.BigFloat maxValue
        public final BigFloat maxValue
        A constant holding the largest positive finite value
      • minValue MODIFIED

        type: BigDecimal → BigFloat
        -java.math.BigDecimal minValue
        +ghidra.pcode.floatformat.BigFloat minValue
        public final BigFloat minValue
        A constant holding the smallest positive normal value

Method Detail

  • round NEW

    public java.math.BigDecimal round​(BigFloat bigFloat)
    Round bigFloat using this format's displayContext.
    Parameters:
    bigFloat - any BigFloat
    Returns:
    a BigDecimal rounded according to this format's displayContext
  • getBigZeroEncoding NEW

    public java.math.BigInteger getBigZeroEncoding​(boolean sgn)
  • getBigZero NEW

    public java.lang.Object getBigZero​(boolean sgn)
  • getBigInfinity NEW

    public BigFloat getBigInfinity​(boolean sgn)
  • getBigNaN NEW

    public BigFloat getBigNaN​(boolean sgn)
  • getBigFloat NEW

    public BigFloat getBigFloat​(float f)
  • getBigFloat NEW

    public BigFloat getBigFloat​(double d)
  • getBigFloat NEW

    public BigFloat getBigFloat​(long encoding)
    Decode encoding to a BigFloat using this format. NB: this method should not be used if size>8
    Parameters:
    encoding - the encoding
    Returns:
    the decoded value as a BigFloat
  • getHostFloat MODIFIED

    return type: BigDecimal → BigFloat
    -java.math.BigDecimal getHostFloat(java.math.BigInteger encoding)
    +ghidra.pcode.floatformat.BigFloat getHostFloat(java.math.BigInteger encoding)
    public BigFloat getHostFloat​(java.math.BigInteger encoding)
  • getEncoding NEW

    public java.math.BigInteger getEncoding​(BigFloat value)
  • toBinaryString NEW

    public java.lang.String toBinaryString​(long encoding)
    Convert an encoded value to a binary floating point representation. NB: this method should not be used if size>8
    Parameters:
    encoding - the encoding of a floating point value in this format
    Returns:
    a binary string representation of the encoded floating point encoding
  • toBigFloat NEW

    public static BigFloat toBigFloat​(float f)
    Parameters:
    f - a float
    Returns:
    BigFloat equal to f
  • toBigFloat NEW

    public static BigFloat toBigFloat​(double d)
    Parameters:
    d - a double
    Returns:
    BigFloat equal to f
  • toBinaryString NEW

    public static java.lang.String toBinaryString​(float f)
    Parameters:
    f - a float
    Returns:
    binary representation of f
  • toBinaryString NEW

    public static java.lang.String toBinaryString​(double d)
    Parameters:
    d - a double
    Returns:
    binary representation of f