Class Decomposed


  • final class Decomposed
    extends Object

    Normalize and decompose a BCDFloat for further formatting

    • Field Detail

      • Composed_String_Length

        private static final int Composed_String_Length
        See Also:
        Constant Field Values
      • Logger

        private static final Logger Logger

        Class logger instance.

      • TAG

        private static final String TAG

        Class logger tag.

      • L_Exponent

        public static final int L_Exponent
        Exponent if an L Register
        See Also:
        Constant Field Values
      • L_Precision

        public static final int L_Precision
        Precision of an L Register
        See Also:
        Constant Field Values
      • M_Precision

        public static final int M_Precision
        Precision of an M Register
        See Also:
        Constant Field Values
      • Exponent

        public final short Exponent
        Mode_Exponent.
      • Exponent_Negative

        public final boolean Exponent_Negative
        True is the Mode_Exponent is negative.
      • Mantissa

        public final long Mantissa
        Mantissa (Normalised to : x.xxxxxxxx)
      • Mantissa_Digits

        public final short Mantissa_Digits
        Mantissa Digits.
      • Mantissa_Negative

        public final boolean Mantissa_Negative
        True is the Coefficient is negative.
    • Constructor Detail

      • Decomposed

        Decomposed​(int[] Bytes)
        Create a decomposed double from an BCD floating point byte array. Note that the Java designers in there great wisdom defined a byte as -128..128 - while in 99% of all cases one need 0..255. Hence we use a int array to pass bytes. As an Ada advocate this mistreatment of datatypes gives me pimples.
        Parameters:
        Bytes - Text containing a value
      • Decomposed

        Decomposed​(long Mantissa,
                   boolean Mantissa_Negative,
                   short Mantissa_Digits,
                   short Exponent,
                   boolean Exponent_Negative)
        Create a decomposed double from it's components
        Parameters:
        Mantissa - Mantissa (Normalized to : x.xxxxxxxx)
        Mantissa_Negative - True is the Coefficient is negative.
        Mantissa_Digits - Mantissa Digits.
        Exponent - Exponent to the power of ten
        Exponent_Negative - True is the Exponent is negative.
      • Decomposed

        Decomposed​(@NotNull
                   Number Value,
                   int Digits)
        Create a decomposed BCDFloat from a normal BCDFloat
        Parameters:
        Value - Value as BCDFloat
        Digits - Round at digits
      • Decomposed

        Decomposed​(short[] Text)
            throws Error
        Create a decomposed double from a normal double
        Parameters:
        Text - Text containing a value
        Throws:
        Error - can't decompose
    • Method Detail

      • Compose

        @NotNull
        public final Number Compose()
        Recompose a double from the given data.
        Returns:
        a double
      • Compose_BCD

        @NotNull
        public final @org.jetbrains.annotations.NotNull int[] Compose_BCD()
        Compose an BCD floating point suitable for saving. Note that the Java designers in there great wisdom defined a byte as -128..128 - while in 99% of all cases one need 0..255. Hence we use a int array to pass bytes. As an Ada advocate this mistreatment of datatypes gives me pimples.
        Returns:
        byte array
      • From_BCD

        private long From_BCD​(int Value)
        create a BCD digits for 2 least significant digits of Value
        Parameters:
        Value - value to create digits from
        Returns:
        BCD value
      • Too_BCD

        private int Too_BCD​(long Value)
        create a BCD digits for 2 least significant digits of Value
        Parameters:
        Value - value to create digits from
        Returns:
        BCD value
      • Trace

        public void Trace()
        Trace current value
      • toString

        @NotNull
        @TestOnly
        public @NotNull String toString()
        Overrides:
        toString in class Object