Module ieee754java

Class Decimal<T extends Decimal<T>>

java.lang.Object
java.lang.Number
at.syntaxerror.ieee754.Floating<T>
at.syntaxerror.ieee754.decimal.Decimal<T>
All Implemented Interfaces:
Serializable, Comparable<T>
Direct Known Subclasses:
Decimal128, Decimal32, Decimal64

public abstract class Decimal<T extends Decimal<T>> extends Floating<T>
This class is the base class for implementing IEEE 754 decimal floating point specifications
Author:
Thomas Kasper
See Also:
  • Field Details

  • Constructor Details

    • Decimal

      public Decimal(int signum, FloatingType type)
    • Decimal

      public Decimal(int signum, BigDecimal value)
  • Method Details

    • encode

      public BigInteger encode()
      Encodes this number into its binary representation using the representation method specified by DEFAULT_CODING.
      Overrides:
      encode in class Floating<T extends Decimal<T>>
      Returns:
      the binary representation
    • encodeDPD

      public BigInteger encodeDPD()
      Encodes this number into its binary representation using the densly packed decimal representation method
      Returns:
      the binary representation
    • encodeBID

      public BigInteger encodeBID()
      Encodes this number into its binary representation using the binary integer decimal representation method
      Returns:
      the binary representation