Top Description Fields Constructors Methods
org.apache.commons.math3.dfp

public Class DfpDec

extends Dfp
Class Inheritance

Subclass of Dfp which hides the radix-10000 artifacts of the superclass. This should give outward appearances 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.
Since
2.2

Field Summary

Inherited from org.apache.commons.math3.dfp.Dfp:
ERR_SCALEexpFINITEINFINITEmantMAX_EXPMIN_EXPnansQNANRADIXsignSNAN

Constructor Summary

AccessConstructor and Description
protected
DfpDec(final DfpField
factory linked to this instance
factory
)

Makes an instance with a value of zero.

protected
DfpDec(final DfpField
factory linked to this instance
factory
,
byte
value to convert to an instance
x
)

Create an instance from a byte value.

protected
DfpDec(final DfpField
factory linked to this instance
factory
,
int
value to convert to an instance
x
)

Create an instance from an int value.

protected
DfpDec(final DfpField
factory linked to this instance
factory
,
long
value to convert to an instance
x
)

Create an instance from a long value.

protected
DfpDec(final DfpField
factory linked to this instance
factory
,
double
value to convert to an instance
x
)

Create an instance from a double value.

public
DfpDec(final Dfp
instance to copy
d
)

Copy constructor.

protected
DfpDec(final DfpField
factory linked to this instance
factory
,
final String
string representation of the instance
s
)

Create an instance from a String representation.

protected
DfpDec(final DfpField
factory linked to this instance
factory
,
final byte
sign of the Dfp to create
sign
,
final byte
code of the value, must be one of INFINITE, SNAN, QNAN
nans
)

Creates an instance with a non-finite value.

Method Summary

Modifier and TypeMethod and Description
protected int

Returns:

number of decimal digits this class is going to represent
getDecimalDigits
()

Get the number of decimal digits this class is going to represent.

public Dfp
newInstance()

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance with a value of 0.

public Dfp
newInstance(final byte
value to convert to an instance
x
)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a byte value.

public Dfp
newInstance(final int
value to convert to an instance
x
)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from an int value.

public Dfp
newInstance(final long
value to convert to an instance
x
)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a long value.

public Dfp
newInstance(final double
value to convert to an instance
x
)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a double value.

public Dfp
newInstance(final Dfp
instance to copy
d
)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance by copying an existing one.

public Dfp
newInstance(final String
string representation of the instance
s
)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a String representation.

public Dfp
newInstance(final byte
sign of the Dfp to create
sign
,
final byte
code of the value, must be one of INFINITE, SNAN, QNAN
nans
)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Creates an instance with a non-finite value.

public Dfp
nextAfter(Dfp
direction where to look at
x
)

Overrides org.apache.commons.math3.dfp.Dfp.nextAfter.

Returns the next number greater than this one in the direction of x.

protected int
round(int
???
in
)

Overrides org.apache.commons.math3.dfp.Dfp.round.

Round this given the next digit n using the current rounding mode.

Inherited from org.apache.commons.math3.dfp.Dfp:
absacosacoshaddaddalignasinasinhatanatan2atanhcbrtceilclassifycomplementcopysigncopySigncopySigncoscoshdfp2scidfp2stringdividedividedividedotrapequalsexpexpm1floorgetFieldgetOnegetRadixDigitsgetRealgetTwogetZerogreaterThanhashCodehypotintLog10intValueisInfiniteisNaNisZerolessThanlinearCombinationlinearCombinationlinearCombinationlinearCombinationlinearCombinationlinearCombinationlinearCombinationlinearCombinationloglog10log10Klog1pmultiplymultiplymultiplynegatenegativeOrNullpositiveOrNullpowpowpowpower10power10KreciprocalremainderremainderrintrootNroundscalbshiftLeftshiftRightsignumsinsinhsqrtstrictlyNegativestrictlyPositivesubtractsubtracttantanhtoDoubletoSplitDoubletoStringtraptruncunequal

Constructor Detail

DfpDecback to summary
protected DfpDec(final DfpField factory)

Makes an instance with a value of zero.

Parameters
factory:DfpField

factory linked to this instance

DfpDecback to summary
protected DfpDec(final DfpField factory, byte x)

Create an instance from a byte value.

Parameters
factory:DfpField

factory linked to this instance

x:byte

value to convert to an instance

DfpDecback to summary
protected DfpDec(final DfpField factory, int x)

Create an instance from an int value.

Parameters
factory:DfpField

factory linked to this instance

x:int

value to convert to an instance

DfpDecback to summary
protected DfpDec(final DfpField factory, long x)

Create an instance from a long value.

Parameters
factory:DfpField

factory linked to this instance

x:long

value to convert to an instance

DfpDecback to summary
protected DfpDec(final DfpField factory, double x)

Create an instance from a double value.

Parameters
factory:DfpField

factory linked to this instance

x:double

value to convert to an instance

DfpDecback to summary
public DfpDec(final Dfp d)

Copy constructor.

Parameters
d:Dfp

instance to copy

DfpDecback to summary
protected DfpDec(final DfpField factory, final String s)

Create an instance from a String representation.

Parameters
factory:DfpField

factory linked to this instance

s:String

string representation of the instance

DfpDecback to summary
protected DfpDec(final DfpField factory, final byte sign, final byte nans)

Creates an instance with a non-finite value.

Parameters
factory:DfpField

factory linked to this instance

sign:byte

sign of the Dfp to create

nans:byte

code of the value, must be one of INFINITE, SNAN, QNAN

Method Detail

getDecimalDigitsback to summary
protected int getDecimalDigits()

Get the number of decimal digits this class is going to represent. Default implementation returns getRadixDigits()*4-3. Subclasses can override this to return something less.

Returns:int

number of decimal digits this class is going to represent

newInstanceback to summary
public Dfp newInstance()

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance with a value of 0. Use this internally in preference to constructors to facilitate subclasses

Returns:Dfp

a new instance with a value of 0

Annotations
@Override
newInstanceback to summary
public Dfp newInstance(final byte x)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a byte value.

Parameters
x:byte

value to convert to an instance

Returns:Dfp

a new instance with value x

Annotations
@Override
newInstanceback to summary
public Dfp newInstance(final int x)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from an int value.

Parameters
x:int

value to convert to an instance

Returns:Dfp

a new instance with value x

Annotations
@Override
newInstanceback to summary
public Dfp newInstance(final long x)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a long value.

Parameters
x:long

value to convert to an instance

Returns:Dfp

a new instance with value x

Annotations
@Override
newInstanceback to summary
public Dfp newInstance(final double x)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a double value.

Parameters
x:double

value to convert to an instance

Returns:Dfp

a new instance with value x

Annotations
@Override
newInstanceback to summary
public Dfp newInstance(final Dfp d)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance by copying an existing one. Use this internally in preference to constructors to facilitate subclasses.

Parameters
d:Dfp

instance to copy

Returns:Dfp

a new instance with the same value as d

Annotations
@Override
newInstanceback to summary
public Dfp newInstance(final String s)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Create an instance from a String representation. Use this internally in preference to constructors to facilitate subclasses.

Parameters
s:String

string representation of the instance

Returns:Dfp

a new instance parsed from specified string

Annotations
@Override
newInstanceback to summary
public Dfp newInstance(final byte sign, final byte nans)

Overrides org.apache.commons.math3.dfp.Dfp.newInstance.

Doc from org.apache.commons.math3.dfp.Dfp.newInstance.

Creates an instance with a non-finite value.

Parameters
sign:byte

sign of the Dfp to create

nans:byte

code of the value, must be one of INFINITE, SNAN, QNAN

Returns:Dfp

a new instance with a non-finite value

Annotations
@Override
nextAfterback to summary
public Dfp nextAfter(Dfp x)

Overrides org.apache.commons.math3.dfp.Dfp.nextAfter.

Doc from org.apache.commons.math3.dfp.Dfp.nextAfter.

Returns the next number greater than this one in the direction of x. If this==x then simply returns this.

Parameters
x:Dfp

direction where to look at

Returns:Dfp

closest number next to instance in the direction of x

Annotations
@Override
roundback to summary
protected int round(int in)

Overrides org.apache.commons.math3.dfp.Dfp.round.

Doc from org.apache.commons.math3.dfp.Dfp.round.

Round this given the next digit n using the current rounding mode.

Parameters
in:int

???

Returns:int

the IEEE flag if an exception occurred

Annotations
@Override