Package gnu.math
Class DFloNum
- All Implemented Interfaces:
Externalizable,Serializable,Comparable
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn this + k * obj.addReversed(Numeric x, int k) Calculatex+k&this.static DFloNumasDFloNumOrNull(Object value) static intcompare(double x, double y) static intCompare (x_num/x_den) with toExact(y).intReturn an integer for which ofthisorobjis larger.intfinal doubleThe value of the real component, as a double.booleaninthashCode()booleanisExact()booleanbooleanisZero()longstatic DFloNummake(double value) Deprecated.neg()static final DFloNumone()Return this raised to an integer power.voidintsign()Return 1 if>0; 0 if==0; -1 if<0; -2 ifNaN.static RatNumtoExact(double value) Converts to the closest exact rational value.toString()static StringtoString(double value) toString(int radix) static DFloNumvalueOf(double value) voidstatic DFloNumzero()Methods inherited from class gnu.math.RealNum
abs, add, angle, asBigDecimal, asRealNumOrNull, classifyFinite, compareTo, conjugate, cos, divide, exp, im, isReal, log, max, min, re, rneg, sin, sqrt, tan, times, toExact, toExactInt, toExactInt, toExactInt, toInexact, toInt, toInt, toScaledInt, toScaledInt, toScaledInt, toStringDecimal, toStringScientific, toStringScientific, toStringScientific, toStringScientific, unitQuaternion, unitVector, vectorPartMethods inherited from class gnu.math.Complex
add, colatitude, compare, complexPart, divide, equals, imMinusOne, imOne, jm, km, longitude, make, make, neg, polar, polar, power, timesMethods inherited from class gnu.math.Quaternion
add, compare, divide, doubleImagValue, doubleJmagValue, doubleKmagValue, doubleRealValue, equals, jmMinusOne, jmOne, kmMinusOne, kmOne, make, make, neg, number, polar, polar, power, timesMethods inherited from class gnu.math.Quantity
add, compare, dimensions, divide, imValue, jmValue, kmValue, make, make, make, reValue, times, unitMethods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, floatValue, geq, grt, intValue, mul_ident, subMethods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
DFloNum
public DFloNum() -
DFloNum
public DFloNum(double value) -
DFloNum
- Throws:
NumberFormatException
-
-
Method Details
-
make
Deprecated. -
valueOf
-
zero
-
asDFloNumOrNull
-
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 classQuaternion
-
longValue
public long longValue()- Overrides:
longValuein classQuaternion
-
hashCode
public int hashCode() -
equals
-
add
Description copied from class:NumericReturn this + k * obj. -
addReversed
Description copied from class:NumericCalculatex+k&this.- Overrides:
addReversedin classComplex
-
mul
-
mulReversed
- Overrides:
mulReversedin classComplex
-
one
-
div
-
divReversed
- Overrides:
divReversedin classComplex
-
power
Description copied from class:NumericReturn this raised to an integer power. Implemented by repeated squaring and multiplication. Ify < 0, returns div_inv of the result. -
isNegative
public boolean isNegative()- Specified by:
isNegativein classRealNum
-
neg
-
sign
public int sign()Description copied from class:RealNumReturn 1 if>0; 0 if==0; -1 if<0; -2 ifNaN. -
compare
public static int compare(double x, double y) -
compare
Compare (x_num/x_den) with toExact(y). -
compare
Description copied from class:NumericReturn an integer for which ofthisorobjis larger. Return 1 ifthis>obj; 0 ifthis==obj; -1 ifthis<obj; -2 ifthis!=objotherwise (for example if either is NaN); -3 if not comparable (incompatible types). -
compareReversed
- Overrides:
compareReversedin classQuantity
-
isExact
public boolean isExact() -
isZero
public boolean isZero() -
toExact
Converts to the closest exact rational value. -
toString
-
toString
-
toString
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-