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 DQuantityReturn this + k * obj.addReversed(Numeric x, int k) Calculatex+k&this.static DQuantityfinal doubleThe value of the real component, as a double.booleanisExact()booleanisZero()final Complexnumber()final RealNumre()The value of the real component, as a RealNum.voidstatic DQuantityfinal Unitunit()voidMethods 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, toStringMethods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, equals, floatValue, geq, grt, intValue, longValue, mul_ident, power, sub, toExact, toInexact, toStringMethods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
DQuantity
-
-
Method Details
-
unit
-
number
-
re
Description copied from class:QuantityThe 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:QuantityThe value of the real component, as a double. This is relative to the unit().dims - i.e. unit()/doubleValue() is factored in.- Overrides:
doubleValuein classQuantity
-
isExact
public boolean isExact() -
isZero
public boolean isZero() -
add
-
times
-
divide
-
add
Description copied from class:NumericReturn this + k * obj. -
addReversed
Description copied from class:NumericCalculatex+k&this.- Overrides:
addReversedin classQuantity
-
mul
-
mulReversed
- Overrides:
mulReversedin classQuantity
-
div
-
divReversed
- Overrides:
divReversedin classQuantity
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-