Package eu.simuline.util
Class RealRepresentation.BigDecimalRep
- java.lang.Object
-
- eu.simuline.util.RealRepresentation
-
- eu.simuline.util.RealRepresentation.BigDecimalRep
-
- Enclosing class:
- RealRepresentation
private static final class RealRepresentation.BigDecimalRep extends RealRepresentation
Describes the representation of aBigDecimal-value. It is characterized by theRealRepresentation.mantissa()and theRealRepresentation.exponent. The mantissa in turn splits into theRealRepresentation.integerand theRealRepresentation.fractional part.- Version:
- 1.0
- Author:
- Ernst Reissner
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class eu.simuline.util.RealRepresentation
RealRepresentation.Cutter, RealRepresentation.Desc
-
-
Field Summary
Fields Modifier and Type Field Description private static intMAX_FRAC_DIGITS_NO_EXPThe number of digits right of the point such that the representation is without exponent.private static intMAX_INT_DIGITS_NO_EXPThe number of digits left of the point such that the representation is without exponent.-
Fields inherited from class eu.simuline.util.RealRepresentation
ALIGN_CUT_OFF_LEFT, ALIGN_CUT_OFF_RIGHT, ALIGN_EXCEPTION, ALIGN_LEAVE_UNCHANGED, EXP_CHAR, exponent, fraction, integer, sign
-
-
Constructor Summary
Constructors Constructor Description BigDecimalRep(java.lang.String dStr)Constructs a newly allocatedBigDecimalRepobject that represents the floating-point value of type double represented by the string.BigDecimalRep(java.math.BigDecimal dec)Constructs a newly allocatedBigDecimalRepthat represents givenBigDecimalargument.
-
Method Summary
-
Methods inherited from class eu.simuline.util.RealRepresentation
alignLeft, alignRight, asInteger, compensatePoint, create, create, create, create, exponent, fill, fraction, hasBlankFraction, hasExponent, hasFraction, hasInteger, initSignExp, integer, mantissa, sign, this2BigDecimal, this2double, this2Double, toString, toString, toStringDecomp, trimExponent, trimFraction, trimInteger
-
-
-
-
Field Detail
-
MAX_FRAC_DIGITS_NO_EXP
private static final int MAX_FRAC_DIGITS_NO_EXP
The number of digits right of the point such that the representation is without exponent. This evaluates to-3as specified for double's inDouble.toString(double)and is used byBigDecimalRep(BigDecimal).- See Also:
- Constant Field Values
-
MAX_INT_DIGITS_NO_EXP
private static final int MAX_INT_DIGITS_NO_EXP
The number of digits left of the point such that the representation is without exponent. This evaluates to7as specified for double's inDouble.toString(double)and is used byBigDecimalRep(BigDecimal).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BigDecimalRep
BigDecimalRep(java.math.BigDecimal dec)
Constructs a newly allocatedBigDecimalRepthat represents givenBigDecimalargument.- Parameters:
dec- the value to be represented by thisBigDecimalRep.
-
BigDecimalRep
BigDecimalRep(java.lang.String dStr)
Constructs a newly allocatedBigDecimalRepobject that represents the floating-point value of type double represented by the string. The string is converted to a double value as if by the methodDouble.valueOf(java.lang.String).- Parameters:
dStr- a string to be converted to aBigDecimalRep.- See Also:
Double(String)
-
-