Package net.sourceforge.uiq3.fx602p
Class Decomposed
- java.lang.Object
-
- net.sourceforge.uiq3.fx602p.Decomposed
-
final class Decomposed extends Object
Normalize and decompose a BCDFloat for further formatting
-
-
Field Summary
Fields Modifier and Type Field Description private static intComposed_String_LengthshortExponentMode_Exponent.booleanExponent_NegativeTrue is the Mode_Exponent is negative.static intL_ExponentExponent if an L Registerstatic intL_PrecisionPrecision of an L Registerprivate static LoggerLoggerClass logger instance.static intM_PrecisionPrecision of an M RegisterlongMantissaMantissa (Normalised to : x.xxxxxxxx)shortMantissa_DigitsMantissa Digits.booleanMantissa_NegativeTrue is the Coefficient is negative.private static intMask_High_Nibbleprivate static intMask_Low_Nibbleprivate static intNegative_Bitprivate static intNibble_Multiplierprivate static StringTAGClass 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 Instance Methods Concrete Methods Modifier and Type Method Description NumberCompose()Recompose a double from the given data.@org.jetbrains.annotations.NotNull int[]Compose_BCD()Compose an BCD floating point suitable for saving.private longFrom_BCD(int Value)create a BCD digits for 2 least significant digits of Valueprivate intToo_BCD(long Value)create a BCD digits for 2 least significant digits of Value@NotNull StringtoString()voidTrace()Trace current value
-
-
-
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.
-
Mask_High_Nibble
private static final int Mask_High_Nibble
- See Also:
- Constant Field Values
-
Mask_Low_Nibble
private static final int Mask_Low_Nibble
- See Also:
- Constant Field Values
-
Negative_Bit
private static final int Negative_Bit
- See Also:
- Constant Field Values
-
Nibble_Multiplier
private static final int Nibble_Multiplier
- See Also:
- Constant Field Values
-
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 tenExponent_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 BCDFloatDigits- Round at digits
-
-
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
-
-