Package gnu.math
Class DQuantity
java.lang.Object
java.lang.Number
gnu.math.Numeric
gnu.math.Quantity
gnu.math.DQuantity
- All Implemented Interfaces:
Externalizable
,Serializable
A Quantity represented as the product of a plain double and a Unit.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DQuantity
Return this + k * obj.addReversed
(Numeric x, int k) Calculatex+k&this
.static DQuantity
final double
The value of the real component, as a double.boolean
isExact()
boolean
isZero()
final Complex
number()
final RealNum
re()
The value of the real component, as a RealNum.void
static DQuantity
final Unit
unit()
void
Methods inherited from class gnu.math.Quantity
abs, add, compare, compare, compareReversed, dimensions, divide, doubleImagValue, doubleJmagValue, doubleKmagValue, im, imValue, jm, jmValue, km, kmValue, make, make, make, neg, reValue, times, toString
Methods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, equals, floatValue, geq, grt, intValue, longValue, mul_ident, power, sub, toExact, toInexact, toString
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
DQuantity
-
-
Method Details
-
unit
-
number
-
re
Description copied from class:Quantity
The value of the real component, as a RealNum. The unit() is not factored in, so you actually need to multiply by unit() to get the true real component. -
doubleValue
public final double doubleValue()Description copied from class:Quantity
The value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleValue
in classQuantity
-
isExact
public boolean isExact() -
isZero
public boolean isZero() -
add
-
times
-
divide
-
add
Description copied from class:Numeric
Return this + k * obj. -
addReversed
Description copied from class:Numeric
Calculatex+k&this
.- Overrides:
addReversed
in classQuantity
-
mul
-
mulReversed
- Overrides:
mulReversed
in classQuantity
-
div
-
divReversed
- Overrides:
divReversed
in classQuantity
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-