com.ibm.eou.decimal
Class DecimalConstants

java.lang.Object
  |
  +--com.ibm.eou.decimal.DecimalConstants

public final class DecimalConstants
extends java.lang.Object

This class provides static types and constants used by library methods on DecimalEncoder and DecimalDecoder for encoding and decoding binary representations of decimal floating-point numbers using the decimal32, decimal64 and decimal128 formats.

Author:
Dave Clark, IBM Ease of Use

Nested Class Summary
static class DecimalConstants.DecimalEncoding
          This class represents an encoding specification.
static class DecimalConstants.RoundingMode
          This class represents a rounding mode.
 
Field Summary
static int BIT_COMBINATION
          Constant specifying the bit position at which the combination field is stored in DecimalNNN formats.
static int BIT_EXPONENT
          Constant specifying the bit position at which the exponent continuation field is stored in DecimalNNN formats.
static int BIT_SIGN
          Constant specifying the bit position at which the sign is stored in DecimalNNN formats.
static DecimalConstants.DecimalEncoding DECIMAL128
          Constant specifying decimal128 encoding.
static DecimalConstants.DecimalEncoding DECIMAL32
          Constant specifying decimal32 encoding.
static DecimalConstants.DecimalEncoding DECIMAL64
          Constant specifying decimal64 encoding.
static DecimalConstants.RoundingMode ROUNDING_CEILING
          Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the positive direction.
static DecimalConstants.RoundingMode ROUNDING_DOWN
          Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the direction towards zero.
static DecimalConstants.RoundingMode ROUNDING_FLOOR
          Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the negative direction.
static DecimalConstants.RoundingMode ROUNDING_HALF_DOWN
          Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in either direction, and exact halves are rounded to the nearest integer in the direction towards zero.
static DecimalConstants.RoundingMode ROUNDING_HALF_EVEN
          Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in either direction, and exact halves are rounded in whichever direction will make the previous digit even.
static DecimalConstants.RoundingMode ROUNDING_HALF_UP
          Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in either direction, and exact halves are rounded to the nearest integer in the direction away from zero.
static DecimalConstants.RoundingMode ROUNDING_UP
          Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the direction away from zero.
 
Constructor Summary
protected DecimalConstants()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DECIMAL32

public static final DecimalConstants.DecimalEncoding DECIMAL32
Constant specifying decimal32 encoding. This encoding uses 32 bits, and accommodates 7 decimal digits of coefficient. It uses 6 bits for the exponent continuation, taking exponents in the range -101 to 90.


DECIMAL64

public static final DecimalConstants.DecimalEncoding DECIMAL64
Constant specifying decimal64 encoding. This encoding uses 64 bits, and accommodates 16 decimal digits of coefficient. It uses 8 bits for the exponent continuation, taking exponents in the range -398 to 369.


DECIMAL128

public static final DecimalConstants.DecimalEncoding DECIMAL128
Constant specifying decimal128 encoding. This encoding uses 128 bits, and accommodates 34 decimal digits of coefficient. It uses 12 bits for the exponent continuation, taking exponents in the range -6176 to 6111.


ROUNDING_FLOOR

public static final DecimalConstants.RoundingMode ROUNDING_FLOOR
Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the negative direction.


ROUNDING_CEILING

public static final DecimalConstants.RoundingMode ROUNDING_CEILING
Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the positive direction.


ROUNDING_DOWN

public static final DecimalConstants.RoundingMode ROUNDING_DOWN
Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the direction towards zero.


ROUNDING_UP

public static final DecimalConstants.RoundingMode ROUNDING_UP
Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in the direction away from zero.


ROUNDING_HALF_DOWN

public static final DecimalConstants.RoundingMode ROUNDING_HALF_DOWN
Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in either direction, and exact halves are rounded to the nearest integer in the direction towards zero.


ROUNDING_HALF_UP

public static final DecimalConstants.RoundingMode ROUNDING_HALF_UP
Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in either direction, and exact halves are rounded to the nearest integer in the direction away from zero.


ROUNDING_HALF_EVEN

public static final DecimalConstants.RoundingMode ROUNDING_HALF_EVEN
Constant specifying a rounding mode in which non-integer finite numbers are rounded to the nearest integer in either direction, and exact halves are rounded in whichever direction will make the previous digit even.


BIT_SIGN

public static final int BIT_SIGN
Constant specifying the bit position at which the sign is stored in DecimalNNN formats.

See Also:
Constant Field Values

BIT_COMBINATION

public static final int BIT_COMBINATION
Constant specifying the bit position at which the combination field is stored in DecimalNNN formats.

See Also:
Constant Field Values

BIT_EXPONENT

public static final int BIT_EXPONENT
Constant specifying the bit position at which the exponent continuation field is stored in DecimalNNN formats.

See Also:
Constant Field Values
Constructor Detail

DecimalConstants

protected DecimalConstants()