Package gnu.math
Class DFloNum
-
- All Implemented Interfaces:
Externalizable,Serializable,Comparable
public class DFloNum extends RealNum implements Externalizable
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Numericadd(Object y, int k)Return this + k * obj.NumericaddReversed(Numeric x, int k)Calculatex+k&this.static DFloNumasDFloNumOrNull(Object value)static intcompare(double x, double y)static intcompare(IntNum x_num, IntNum x_den, double y)Compare (x_num/x_den) with toExact(y).intcompare(Object obj)Return an integer for which ofthisorobjis larger.intcompareReversed(Numeric x)Numericdiv(Object y)NumericdivReversed(Numeric x)doubledoubleValue()The value of the real component, as a double.booleanequals(Object obj)inthashCode()booleanisExact()booleanisNegative()booleanisZero()longlongValue()static DFloNummake(double value)Deprecated.Numericmul(Object y)NumericmulReversed(Numeric x)Numericneg()static DFloNumone()Numericpower(IntNum y)Return this raised to an integer power.voidreadExternal(ObjectInput in)intsign()Return 1 if>0; 0 if==0; -1 if<0; -2 ifNaN.static RatNumtoExact(double value)Converts to the closest exact rational value.StringtoString()static StringtoString(double value)StringtoString(int radix)static DFloNumvalueOf(double value)voidwriteExternal(ObjectOutput out)static 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, vectorPart
-
Methods inherited from class gnu.math.Complex
add, colatitude, compare, complexPart, divide, equals, imMinusOne, imOne, jm, km, longitude, make, make, neg, polar, polar, power, times
-
Methods 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, times
-
Methods inherited from class gnu.math.Quantity
add, compare, dimensions, divide, imValue, jmValue, kmValue, make, make, make, reValue, times, unit
-
Methods inherited from class gnu.math.Numeric
add, asNumericOrNull, div_inv, floatValue, geq, grt, intValue, mul_ident, sub
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Constructor Detail
-
DFloNum
public DFloNum()
-
DFloNum
public DFloNum(double value)
-
DFloNum
public DFloNum(String s) throws NumberFormatException
- Throws:
NumberFormatException
-
-
Method Detail
-
make
@Deprecated public static DFloNum make(double value)
Deprecated.
-
valueOf
public static DFloNum valueOf(double value)
-
zero
public static DFloNum zero()
-
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
-
add
public Numeric add(Object y, int k)
Description copied from class:NumericReturn this + k * obj.
-
addReversed
public Numeric addReversed(Numeric x, int k)
Description copied from class:NumericCalculatex+k&this.- Overrides:
addReversedin classComplex
-
mulReversed
public Numeric mulReversed(Numeric x)
- Overrides:
mulReversedin classComplex
-
one
public static final DFloNum one()
-
divReversed
public Numeric divReversed(Numeric x)
- Overrides:
divReversedin classComplex
-
power
public Numeric power(IntNum y)
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
-
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
public static int compare(IntNum x_num, IntNum x_den, double y)
Compare (x_num/x_den) with toExact(y).
-
compare
public int compare(Object obj)
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
public int compareReversed(Numeric x)
- Overrides:
compareReversedin classQuantity
-
toExact
public static RatNum toExact(double value)
Converts to the closest exact rational value.
-
toString
public static String toString(double value)
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
-