Package net.sourceforge.uiq3.fx603p
Class Decomposed
- java.lang.Object
-
- net.sourceforge.uiq3.fx603p.Decomposed
-
public final class Decomposed extends Object
Normalize BCDFloat for further formating
-
-
Field Summary
Fields Modifier and Type Field Description static int
BCD_Length
short
Exponent
Mode_Exponent.boolean
Exponent_Negative
True is the Mode_Exponent is negative.static int
L_Exponent
Exponent if an L Registerstatic int
L_Precision
Precision of an L Registerprivate static Logger
logger
class logger instancelong
Mantissa
Mantissa (Normalised to : x.xxxxxxxx)short
Mantissa_Digits
Mantissa Digits.boolean
Mantissa_Negative
True is the Coefficient is negative.private static String
TAG
class logger tag.
-
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 componentsDecomposed(short[] Text)
Create a decomposed double from a normal doubleDecomposed(Number Value, int Digits)
Create a decomposed BCDFloat from a normal BCDFloat
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BCDFloat
Compose()
Recompose a double from the given data.@org.jetbrains.annotations.NotNull int[]
Compose_BCD()
Compose an BCD floating point suitable for saving.private long
From_BCD(int Value)
create a BCD digits for 2 least significant digits of Valueprivate int
Too_BCD(long Value)
create a BCD digits for 2 least significant digits of ValueString
toString()
Returns a string representation of the object.void
Trace()
Trace current valuestatic void
Trace(int[] Buffer)
Trace current value
-
-
-
Field Detail
-
BCD_Length
public static final int BCD_Length
- See Also:
- Constant Field Values
-
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 tenExponent_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 BCDFloatDigits
- Round at digits
-
-
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, thetoString
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. ThetoString
method for classObject
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 ())
-
Trace
public void Trace()
Trace current value
-
-