Interface ApfloatImpl

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    DoubleApfloatImpl, FloatApfloatImpl, IntApfloatImpl, LongApfloatImpl

    public interface ApfloatImpl
    extends java.io.Serializable
    Interface for apfloat implementations. An ApfloatImpl implements all of the low-level functionality that is needed behind the high-level apfloat API.

    A class implementing ApfloatImpl is not required to accept any other ApfloatImpl class as the argument than the same implementing class.

    Version:
    1.7.0
    • Method Detail

      • addOrSubtract

        ApfloatImpl addOrSubtract​(ApfloatImpl x,
                                  boolean subtract)
                           throws ApfloatRuntimeException
        Add or subtract an ApfloatImpl to this object.
        Parameters:
        x - The number to be added or subtracted to this ApfloatImpl.
        subtract - true if the numbers are to be subtracted, false if added.
        Returns:
        this + x or this - x depending on the subtract argument.
        Throws:
        ApfloatRuntimeException
      • isShort

        boolean isShort()
                 throws ApfloatRuntimeException
        Returns if this ApfloatImpl is "short". Typically ApfloatImpl is "short" if its mantissa fits in one machine word. If the apfloat is "short", some algorithms can be performed faster.

        The return value of this method is highly implementation dependent.

        Returns:
        true if the ApfloatImpl is "short", false if not.
        Throws:
        ApfloatRuntimeException
        See Also:
        Apfloat.isShort()
      • radix

        int radix()
        Returns the radix of this ApfloatImpl.
        Returns:
        The radix of this ApfloatImpl.
      • precision

        long precision()
        Returns the precision of this ApfloatImpl.
        Returns:
        The precision of this ApfloatImpl.
      • signum

        int signum()
        Returns the signum of this ApfloatImpl.
        Returns:
        The signum of this ApfloatImpl.
        See Also:
        Apfloat.signum()
      • doubleValue

        double doubleValue()
        Returns the value of the this number as a double. If the number is greater than Double.MAX_VALUE, then Double.POSITIVE_INFINITY is returned.

        If the number is less than Double.MIN_VALUE, then Double.NEGATIVE_INFINITY is returned.

        If the number is very small in magnitude, underflow may happen and zero is returned.

        Returns:
        The numeric value represented by this object after conversion to type double.
      • longValue

        long longValue()
        Returns the value of the this number as a long. The fractional part is truncated towards zero.

        If the number is greater than Long.MAX_VALUE, then Long.MAX_VALUE is returned.

        If the number is less than Long.MIN_VALUE, then Long.MIN_VALUE is returned.

        Returns:
        The numeric value represented by this object after conversion to type long.
      • hashCode

        int hashCode()
        Returns the hash code for this ApfloatImpl.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code for this ApfloatImpl.