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 Numeric
add(Object y, int k)
Return this + k * obj.Numeric
addReversed(Numeric x, int k)
Calculatex+k&this
.static DFloNum
asDFloNumOrNull(Object value)
static int
compare(double x, double y)
static int
compare(IntNum x_num, IntNum x_den, double y)
Compare (x_num/x_den) with toExact(y).int
compare(Object obj)
Return an integer for which ofthis
orobj
is larger.int
compareReversed(Numeric x)
Numeric
div(Object y)
Numeric
divReversed(Numeric x)
double
doubleValue()
The value of the real component, as a double.boolean
equals(Object obj)
int
hashCode()
boolean
isExact()
boolean
isNegative()
boolean
isZero()
long
longValue()
static DFloNum
make(double value)
Deprecated.Numeric
mul(Object y)
Numeric
mulReversed(Numeric x)
Numeric
neg()
static DFloNum
one()
Numeric
power(IntNum y)
Return this raised to an integer power.void
readExternal(ObjectInput in)
int
sign()
Return 1 if>0
; 0 if==0
; -1 if<0
; -2 ifNaN
.static RatNum
toExact(double value)
Converts to the closest exact rational value.String
toString()
static String
toString(double value)
String
toString(int radix)
static DFloNum
valueOf(double value)
void
writeExternal(ObjectOutput out)
static DFloNum
zero()
-
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: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 classQuaternion
-
longValue
public long longValue()
- Overrides:
longValue
in classQuaternion
-
add
public Numeric add(Object y, int k)
Description copied from class:Numeric
Return this + k * obj.
-
addReversed
public Numeric addReversed(Numeric x, int k)
Description copied from class:Numeric
Calculatex+k&this
.- Overrides:
addReversed
in classComplex
-
mulReversed
public Numeric mulReversed(Numeric x)
- Overrides:
mulReversed
in classComplex
-
one
public static final DFloNum one()
-
divReversed
public Numeric divReversed(Numeric x)
- Overrides:
divReversed
in classComplex
-
power
public Numeric power(IntNum y)
Description copied from class:Numeric
Return 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:
isNegative
in classRealNum
-
sign
public int sign()
Description copied from class:RealNum
Return 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:Numeric
Return an integer for which ofthis
orobj
is larger. Return 1 ifthis>obj
; 0 ifthis==obj
; -1 ifthis<obj
; -2 ifthis!=obj
otherwise (for example if either is NaN); -3 if not comparable (incompatible types).
-
compareReversed
public int compareReversed(Numeric x)
- Overrides:
compareReversed
in 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:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
-