public class DoubleScalar extends Scalar implements java.lang.Cloneable, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
double |
val
The (mutable) scalar value.
|
Constructor and Description |
---|
DoubleScalar()
Creates a new double Scalar set to 0.
|
DoubleScalar(double x)
Creates a new double Scalar initialized to x.
|
DoubleScalar(DoubleScalar x)
Creates a copy of x.
|
Modifier and Type | Method and Description |
---|---|
DoubleScalar |
clone()
Returns a copy of this.
|
int |
cmp(DoubleScalar x)
Returns -1, 0, 1 if this is respectively strictly smaller, equal, or
strictly greater than x.
|
int |
cmp(int x)
Returns -1, 0, 1 if this is respectively strictly smaller, equal, or
strictly greater than x.
|
int |
cmp(Scalar x)
Returns -1, 0, 1 if this is respectively strictly smaller, equal, or
strictly greater than x.
|
DoubleScalar |
copy()
Creates a copy of the Scalar, of the same kind.
|
double |
get()
Returns the underlying double.
|
int |
hashCode()
Returns a hash of the value of this.
|
void |
inv()
Inverts this (with rounding).
|
boolean |
isEqual(DoubleScalar x)
Whether this and x have the same value.
|
boolean |
isEqual(int x)
Whether this and x have the same value.
|
boolean |
isEqual(Scalar x)
Whether this and x have the same value.
|
int |
isInfty()
Returns -1, 0 or 1 if this is respectively -oo, finite, or +oo.
|
boolean |
isZero()
Whether this equals 0.
|
void |
neg()
Negates this (exact).
|
void |
set(double x)
Copies the value of x into this.
|
void |
set(DoubleScalar x)
Copies the value of x into this.
|
void |
set(int x)
Sets this to x.
|
void |
setInfty(int sign)
Sets the scalar to +oo or -oo.
|
int |
sgn()
Returns the sign of this.
|
int |
toDouble(double[] r,
int round)
Copies the value of this into r (exact).
|
int |
toMpfr(Mpfr r,
int round)
Copies the value of this into r (with rounding).
|
int |
toMpq(Mpq r,
int round)
Copies the value of this into r (exact, except if NaN).
|
java.lang.String |
toString()
Returns a string representation of the value of this.
|
public DoubleScalar()
public DoubleScalar(DoubleScalar x)
public DoubleScalar(double x)
public DoubleScalar copy()
Scalar
public void set(DoubleScalar x)
public void set(double x)
public void setInfty(int sign)
The result is +oo if sign is strictly positive, -oo if sign is strictly negative, 0 if sign is null.
public double get()
public int toMpq(Mpq r, int round)
public int toMpfr(Mpfr r, int round)
public int toDouble(double[] r, int round)
public java.lang.String toString()
public int hashCode()
public int isInfty()
public int cmp(DoubleScalar x)
public int cmp(int x)
public int cmp(Scalar x)
public boolean isEqual(DoubleScalar x)
public boolean isEqual(int x)
public boolean isEqual(Scalar x)
public DoubleScalar clone()
clone
in class java.lang.Object