Class Decomposed


  • public final class Decomposed
    extends Object
    Normalize BCDFloat for further formating
    • Constructor Summary

      Constructors 
      Constructor Description
      Decomposed​(int[] Bytes)
      Create a decomposed double from an BCD floating point byte array.
      Decomposed​(long Mantissa, boolean Mantissa_Negative, short Mantissa_Digits, short Exponent, boolean Exponent_Negative)
      Create a decomposed double from it's components
      Decomposed​(short[] Text)
      Create a decomposed double from a normal double
      Decomposed​(Number Value, int Digits)
      Create a decomposed BCDFloat from a normal BCDFloat
    • Field Detail

      • 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
      • logger

        private static final Logger logger

        class logger instance

      • TAG

        private static final String TAG

        class logger tag.

      • 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

        public 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

        public 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

      • Trace

        public static void Trace​(int[] Buffer)
        Trace current value
      • Compose

        @NotNull
        public final BCDFloat 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
      • toString

        @TestOnly
        public String toString()
        Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

        The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character ` @', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

         getClass ().getName () + '@' + Integer.toHexString (hashCode ())
         
        Overrides:
        toString in class Object
        Returns:
        a string representation of the object.
      • Trace

        public void Trace()
        Trace current value