|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
org.apache.commons.math3.util.Decimal64
public class Decimal64
This class wraps a double
value in an object. It is similar to the
standard class Double
, while also implementing the
RealFieldElement
interface.
Field Summary | |
---|---|
static Decimal64 |
NAN
The constant value of Double.NaN as a Decimal64 . |
static Decimal64 |
NEGATIVE_INFINITY
The constant value of Double.NEGATIVE_INFINITY as a
Decimal64 . |
static Decimal64 |
ONE
The constant value of 1d as a Decimal64 . |
static Decimal64 |
POSITIVE_INFINITY
The constant value of Double.POSITIVE_INFINITY as a
Decimal64 . |
private static long |
serialVersionUID
|
private double |
value
The primitive double value of this object. |
static Decimal64 |
ZERO
The constant value of 0d as a Decimal64 . |
Constructor Summary | |
---|---|
Decimal64(double x)
Creates a new instance of this class. |
Method Summary | |
---|---|
Decimal64 |
abs()
absolute value. |
Decimal64 |
acos()
Arc cosine operation. |
Decimal64 |
acosh()
Inverse hyperbolic cosine operation. |
Decimal64 |
add(Decimal64 a)
Compute this + a. |
Decimal64 |
add(double a)
'+' operator. |
Decimal64 |
asin()
Arc sine operation. |
Decimal64 |
asinh()
Inverse hyperbolic sine operation. |
Decimal64 |
atan()
Arc tangent operation. |
Decimal64 |
atan2(Decimal64 x)
Two arguments arc tangent operation. |
Decimal64 |
atanh()
Inverse hyperbolic tangent operation. |
byte |
byteValue()
The current implementation performs casting to a byte . |
Decimal64 |
cbrt()
Cubic root. |
Decimal64 |
ceil()
Get the smallest whole number larger than instance. |
int |
compareTo(Decimal64 o)
The current implementation returns the same value as new Double(this.doubleValue()).compareTo(new
Double(o.doubleValue())) |
Decimal64 |
copySign(Decimal64 sign)
Returns the instance with the sign of the argument. |
Decimal64 |
copySign(double sign)
Returns the instance with the sign of the argument. |
Decimal64 |
cos()
Cosine operation. |
Decimal64 |
cosh()
Hyperbolic cosine operation. |
Decimal64 |
divide(Decimal64 a)
Compute this ÷ a. |
Decimal64 |
divide(double a)
'÷s;' operator. |
double |
doubleValue()
|
boolean |
equals(Object obj)
|
Decimal64 |
exp()
Exponential. |
Decimal64 |
expm1()
Exponential minus 1. |
float |
floatValue()
The current implementation performs casting to a float . |
Decimal64 |
floor()
Get the largest whole number smaller than instance. |
Field<Decimal64> |
getField()
Get the Field to which the instance belongs. |
double |
getReal()
Get the real value of the number. |
int |
hashCode()
The current implementation returns the same value as new Double(this.doubleValue()).hashCode() |
Decimal64 |
hypot(Decimal64 y)
Returns the hypotenuse of a triangle with sides this and y
- sqrt(this2 +y2)avoiding intermediate overflow or underflow. |
int |
intValue()
The current implementation performs casting to a int . |
boolean |
isInfinite()
Returns true if this double precision number is infinite
(Double.POSITIVE_INFINITY or Double.NEGATIVE_INFINITY ). |
boolean |
isNaN()
Returns true if this double precision number is
Not-a-Number (NaN ), false otherwise. |
Decimal64 |
linearCombination(Decimal64[] a,
Decimal64[] b)
Compute a linear combination. |
Decimal64 |
linearCombination(Decimal64 a1,
Decimal64 b1,
Decimal64 a2,
Decimal64 b2)
Compute a linear combination. |
Decimal64 |
linearCombination(Decimal64 a1,
Decimal64 b1,
Decimal64 a2,
Decimal64 b2,
Decimal64 a3,
Decimal64 b3)
Compute a linear combination. |
Decimal64 |
linearCombination(Decimal64 a1,
Decimal64 b1,
Decimal64 a2,
Decimal64 b2,
Decimal64 a3,
Decimal64 b3,
Decimal64 a4,
Decimal64 b4)
Compute a linear combination. |
Decimal64 |
linearCombination(double[] a,
Decimal64[] b)
Compute a linear combination. |
Decimal64 |
linearCombination(double a1,
Decimal64 b1,
double a2,
Decimal64 b2)
Compute a linear combination. |
Decimal64 |
linearCombination(double a1,
Decimal64 b1,
double a2,
Decimal64 b2,
double a3,
Decimal64 b3)
Compute a linear combination. |
Decimal64 |
linearCombination(double a1,
Decimal64 b1,
double a2,
Decimal64 b2,
double a3,
Decimal64 b3,
double a4,
Decimal64 b4)
Compute a linear combination. |
Decimal64 |
log()
Natural logarithm. |
Decimal64 |
log10()
Base 10 logarithm. |
Decimal64 |
log1p()
Shifted natural logarithm. |
long |
longValue()
The current implementation performs casting to a long . |
Decimal64 |
multiply(Decimal64 a)
Compute this × a. |
Decimal64 |
multiply(double a)
'×' operator. |
Decimal64 |
multiply(int n)
Compute n × this. |
Decimal64 |
negate()
Returns the additive inverse of this element. |
Decimal64 |
pow(Decimal64 e)
Power operation. |
Decimal64 |
pow(double p)
Power operation. |
Decimal64 |
pow(int n)
Integer power operation. |
Decimal64 |
reciprocal()
Returns the multiplicative inverse of this element. |
Decimal64 |
remainder(Decimal64 a)
IEEE remainder operator. |
Decimal64 |
remainder(double a)
IEEE remainder operator. |
Decimal64 |
rint()
Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers. |
Decimal64 |
rootN(int n)
Nth root. |
long |
round()
Get the closest long to instance value. |
Decimal64 |
scalb(int n)
Multiply the instance by a power of 2. |
short |
shortValue()
The current implementation performs casting to a short . |
Decimal64 |
signum()
Compute the signum of the instance. |
Decimal64 |
sin()
Sine operation. |
Decimal64 |
sinh()
Hyperbolic sine operation. |
Decimal64 |
sqrt()
Square root. |
Decimal64 |
subtract(Decimal64 a)
Compute this - a. |
Decimal64 |
subtract(double a)
'-' operator. |
Decimal64 |
tan()
Tangent operation. |
Decimal64 |
tanh()
Hyperbolic tangent operation. |
String |
toString()
The returned String is equal to
Double.toString(this.doubleValue()) |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Decimal64 ZERO
0d
as a Decimal64
.
public static final Decimal64 ONE
1d
as a Decimal64
.
public static final Decimal64 NEGATIVE_INFINITY
Double.NEGATIVE_INFINITY
as a
Decimal64
.
public static final Decimal64 POSITIVE_INFINITY
Double.POSITIVE_INFINITY
as a
Decimal64
.
public static final Decimal64 NAN
Double.NaN
as a Decimal64
.
private static final long serialVersionUID
private final double value
double
value of this object.
Constructor Detail |
---|
public Decimal64(double x)
x
- the primitive double
value of the object to be createdMethod Detail |
---|
public Field<Decimal64> getField()
Field
to which the instance belongs.
getField
in interface FieldElement<Decimal64>
Field
to which the instance belongspublic Decimal64 add(Decimal64 a)
this.add(a).equals(new Decimal64(this.doubleValue()
+ a.doubleValue()))
.
add
in interface FieldElement<Decimal64>
a
- element to add
public Decimal64 subtract(Decimal64 a)
this.subtract(a).equals(new Decimal64(this.doubleValue()
- a.doubleValue()))
.
subtract
in interface FieldElement<Decimal64>
a
- element to subtract
public Decimal64 negate()
this
element.
The current implementation strictly enforces
this.negate().equals(new Decimal64(-this.doubleValue()))
.
negate
in interface FieldElement<Decimal64>
this
.public Decimal64 multiply(Decimal64 a)
this.multiply(a).equals(new Decimal64(this.doubleValue()
* a.doubleValue()))
.
multiply
in interface FieldElement<Decimal64>
a
- element to multiply
public Decimal64 multiply(int n)
this.multiply(n).equals(new Decimal64(n * this.doubleValue()))
.
multiply
in interface FieldElement<Decimal64>
n
- Number of times this
must be added to itself.
public Decimal64 divide(Decimal64 a)
this.divide(a).equals(new Decimal64(this.doubleValue()
/ a.doubleValue()))
.
divide
in interface FieldElement<Decimal64>
a
- element to add
public Decimal64 reciprocal()
this
element.
The current implementation strictly enforces
this.reciprocal().equals(new Decimal64(1.0
/ this.doubleValue()))
.
reciprocal
in interface FieldElement<Decimal64>
reciprocal
in interface RealFieldElement<Decimal64>
this
.public byte byteValue()
byte
.
byteValue
in class Number
public short shortValue()
short
.
shortValue
in class Number
public int intValue()
int
.
intValue
in class Number
public long longValue()
long
.
longValue
in class Number
public float floatValue()
float
.
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number
public int compareTo(Decimal64 o)
new Double(this.doubleValue()).compareTo(new
Double(o.doubleValue()))
compareTo
in interface Comparable<Decimal64>
Double.compareTo(Double)
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
new Double(this.doubleValue()).hashCode()
hashCode
in class Object
Double.hashCode()
public String toString()
String
is equal to
Double.toString(this.doubleValue())
toString
in class Object
Double.toString(double)
public boolean isInfinite()
true
if this
double precision number is infinite
(Double.POSITIVE_INFINITY
or Double.NEGATIVE_INFINITY
).
true
if this
number is infinitepublic boolean isNaN()
true
if this
double precision number is
Not-a-Number (NaN
), false otherwise.
true
if this
is NaN
public double getReal()
getReal
in interface RealFieldElement<Decimal64>
public Decimal64 add(double a)
add
in interface RealFieldElement<Decimal64>
a
- right hand side parameter of the operator
public Decimal64 subtract(double a)
subtract
in interface RealFieldElement<Decimal64>
a
- right hand side parameter of the operator
public Decimal64 multiply(double a)
multiply
in interface RealFieldElement<Decimal64>
a
- right hand side parameter of the operator
public Decimal64 divide(double a)
divide
in interface RealFieldElement<Decimal64>
a
- right hand side parameter of the operator
public Decimal64 remainder(double a)
remainder
in interface RealFieldElement<Decimal64>
a
- right hand side parameter of the operator
public Decimal64 remainder(Decimal64 a)
remainder
in interface RealFieldElement<Decimal64>
a
- right hand side parameter of the operator
public Decimal64 abs()
abs
in interface RealFieldElement<Decimal64>
public Decimal64 ceil()
ceil
in interface RealFieldElement<Decimal64>
public Decimal64 floor()
floor
in interface RealFieldElement<Decimal64>
public Decimal64 rint()
rint
in interface RealFieldElement<Decimal64>
public long round()
round
in interface RealFieldElement<Decimal64>
RealFieldElement.getReal()
public Decimal64 signum()
signum
in interface RealFieldElement<Decimal64>
public Decimal64 copySign(Decimal64 sign)
sign
argument is treated as positive.
copySign
in interface RealFieldElement<Decimal64>
sign
- the sign for the returned value
sign
argumentpublic Decimal64 copySign(double sign)
sign
argument is treated as positive.
copySign
in interface RealFieldElement<Decimal64>
sign
- the sign for the returned value
sign
argumentpublic Decimal64 scalb(int n)
scalb
in interface RealFieldElement<Decimal64>
n
- power of 2
public Decimal64 hypot(Decimal64 y)
this
and y
- sqrt(this2 +y2)
hypot
in interface RealFieldElement<Decimal64>
y
- a value
public Decimal64 sqrt()
sqrt
in interface RealFieldElement<Decimal64>
public Decimal64 cbrt()
cbrt
in interface RealFieldElement<Decimal64>
public Decimal64 rootN(int n)
rootN
in interface RealFieldElement<Decimal64>
n
- order of the root
public Decimal64 pow(double p)
pow
in interface RealFieldElement<Decimal64>
p
- power to apply
public Decimal64 pow(int n)
pow
in interface RealFieldElement<Decimal64>
n
- power to apply
public Decimal64 pow(Decimal64 e)
pow
in interface RealFieldElement<Decimal64>
e
- exponent
public Decimal64 exp()
exp
in interface RealFieldElement<Decimal64>
public Decimal64 expm1()
expm1
in interface RealFieldElement<Decimal64>
public Decimal64 log()
log
in interface RealFieldElement<Decimal64>
public Decimal64 log1p()
log1p
in interface RealFieldElement<Decimal64>
public Decimal64 log10()
public Decimal64 cos()
cos
in interface RealFieldElement<Decimal64>
public Decimal64 sin()
sin
in interface RealFieldElement<Decimal64>
public Decimal64 tan()
tan
in interface RealFieldElement<Decimal64>
public Decimal64 acos()
acos
in interface RealFieldElement<Decimal64>
public Decimal64 asin()
asin
in interface RealFieldElement<Decimal64>
public Decimal64 atan()
atan
in interface RealFieldElement<Decimal64>
public Decimal64 atan2(Decimal64 x)
atan2
in interface RealFieldElement<Decimal64>
x
- second argument of the arc tangent
public Decimal64 cosh()
cosh
in interface RealFieldElement<Decimal64>
public Decimal64 sinh()
sinh
in interface RealFieldElement<Decimal64>
public Decimal64 tanh()
tanh
in interface RealFieldElement<Decimal64>
public Decimal64 acosh()
acosh
in interface RealFieldElement<Decimal64>
public Decimal64 asinh()
asinh
in interface RealFieldElement<Decimal64>
public Decimal64 atanh()
atanh
in interface RealFieldElement<Decimal64>
public Decimal64 linearCombination(Decimal64[] a, Decimal64[] b) throws DimensionMismatchException
linearCombination
in interface RealFieldElement<Decimal64>
a
- Factors.b
- Factors.
Σi ai bi
.
DimensionMismatchException
- if arrays dimensions don't matchpublic Decimal64 linearCombination(double[] a, Decimal64[] b) throws DimensionMismatchException
linearCombination
in interface RealFieldElement<Decimal64>
a
- Factors.b
- Factors.
Σi ai bi
.
DimensionMismatchException
- if arrays dimensions don't matchpublic Decimal64 linearCombination(Decimal64 a1, Decimal64 b1, Decimal64 a2, Decimal64 b2)
linearCombination
in interface RealFieldElement<Decimal64>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second term
RealFieldElement.linearCombination(Object, Object, Object, Object, Object, Object)
,
RealFieldElement.linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
public Decimal64 linearCombination(double a1, Decimal64 b1, double a2, Decimal64 b2)
linearCombination
in interface RealFieldElement<Decimal64>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second term
RealFieldElement.linearCombination(double, Object, double, Object, double, Object)
,
RealFieldElement.linearCombination(double, Object, double, Object, double, Object, double, Object)
public Decimal64 linearCombination(Decimal64 a1, Decimal64 b1, Decimal64 a2, Decimal64 b2, Decimal64 a3, Decimal64 b3)
linearCombination
in interface RealFieldElement<Decimal64>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third term
RealFieldElement.linearCombination(Object, Object, Object, Object)
,
RealFieldElement.linearCombination(Object, Object, Object, Object, Object, Object, Object, Object)
public Decimal64 linearCombination(double a1, Decimal64 b1, double a2, Decimal64 b2, double a3, Decimal64 b3)
linearCombination
in interface RealFieldElement<Decimal64>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third term
RealFieldElement.linearCombination(double, Object, double, Object)
,
RealFieldElement.linearCombination(double, Object, double, Object, double, Object, double, Object)
public Decimal64 linearCombination(Decimal64 a1, Decimal64 b1, Decimal64 a2, Decimal64 b2, Decimal64 a3, Decimal64 b3, Decimal64 a4, Decimal64 b4)
linearCombination
in interface RealFieldElement<Decimal64>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third terma4
- first factor of the third termb4
- second factor of the third term
RealFieldElement.linearCombination(Object, Object, Object, Object)
,
RealFieldElement.linearCombination(Object, Object, Object, Object, Object, Object)
public Decimal64 linearCombination(double a1, Decimal64 b1, double a2, Decimal64 b2, double a3, Decimal64 b3, double a4, Decimal64 b4)
linearCombination
in interface RealFieldElement<Decimal64>
a1
- first factor of the first termb1
- second factor of the first terma2
- first factor of the second termb2
- second factor of the second terma3
- first factor of the third termb3
- second factor of the third terma4
- first factor of the third termb4
- second factor of the third term
RealFieldElement.linearCombination(double, Object, double, Object)
,
RealFieldElement.linearCombination(double, Object, double, Object, double, Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |