rossi.dfp
Class dfpdec

java.lang.Object
  |
  +--rossi.dfp.dfp
        |
        +--rossi.dfp.dfpdec

public class dfpdec
extends dfp

Subclass of dfp which hides the radix-10000 artifacts of the superclass. This should give outward apperances of being a decimal number with DIGITS*4-3 decimal digits. This class can be subclassed to appear to be an arbitrary number of decimal digits less than DIGITS*4-3.


Field Summary
protected static int maxdigits
           
 
Fields inherited from class rossi.dfp.dfp
DIGITS, errScale, exp, FINITE, FLAG_DIV_ZERO, FLAG_INEXACT, FLAG_INVALID, FLAG_OVERFLOW, FLAG_UNDERFLOW, ieeeFlags, INFINITE, mant, maxExp, minExp, nans, one, QNAN, radix, rMode, ROUND_CEIL, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_DOWN, ROUND_HALF_EVEN, ROUND_HALF_ODD, ROUND_HALF_UP, ROUND_UP, sign, SNAN, two, zero
 
Constructor Summary
dfpdec()
           
dfpdec(dfp d)
           
dfpdec(java.lang.String s)
           
 
Method Summary
protected  int getDecimalDigits()
          Return the number of decimal digits this class is going to represent.
 dfp newInstance()
           
 dfp newInstance(dfp d)
          Create a dfp.
 dfp newInstance(java.lang.String s)
          Create a dfp.
 dfp nextAfter(dfp x)
          Returns the next number greater than this one in the direction of x.
protected  int round(int in)
          round this given the next digit n using the current rounding mode returns a flag if an exception occured
 
Methods inherited from class rossi.dfp.dfp
add, align, ceil, classify, clearIEEEFlags, compare, complement, copysign, create, dfp2sci, dfp2string, divide, divide, dotrap, equal, floor, getIEEEFlags, getRoundingMode, greaterThan, intValue, lessThan, log10, log10K, multiply, multiply, negate, power10, power10K, remainder, rint, setIEEEFlags, setRoundingMode, shiftLeft, shiftRight, sqrt, string2dfp, subtract, toString, trap, trunc, unequal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

maxdigits

protected static final int maxdigits
See Also:
Constant Field Values
Constructor Detail

dfpdec

public dfpdec()

dfpdec

public dfpdec(dfp d)

dfpdec

public dfpdec(java.lang.String s)
Method Detail

newInstance

public dfp newInstance()

newInstance

public dfp newInstance(dfp d)
Description copied from class: dfp
Create a dfp. Use this internally in preferenct to constructors to facilitate subclasses.

Overrides:
newInstance in class dfp

newInstance

public dfp newInstance(java.lang.String s)
Description copied from class: dfp
Create a dfp. Use this internally in preferenct to constructors to facilitate subclasses.

Overrides:
newInstance in class dfp

getDecimalDigits

protected int getDecimalDigits()
Return the number of decimal digits this class is going to represent. Default implementation returns DIGITS*4-3. Subclasses can override this to return something less.


round

protected int round(int in)
round this given the next digit n using the current rounding mode returns a flag if an exception occured

Overrides:
round in class dfp

nextAfter

public dfp nextAfter(dfp x)
Returns the next number greater than this one in the direction of x. If this==x then simply returns this.

Overrides:
nextAfter in class dfp