public class MpfrScalar extends Scalar implements java.lang.Cloneable, java.io.Serializable
Mpfr
multi-precision floating-point number.Constructor and Description |
---|
MpfrScalar()
Creates a new Mpfr Scalar set to NaN.
|
MpfrScalar(double x,
int round)
Creates a new Mpfr Scalar holding a copy of x.
|
MpfrScalar(int prec)
Creates a new Mpfr Scalar with the given precision, set to NaN.
|
MpfrScalar(Mpfr x)
Creates a new Mpfr Scalar holding a copy of x.
|
MpfrScalar(MpfrScalar x)
Creates a copy of x.
|
Modifier and Type | Method and Description |
---|---|
MpfrScalar |
clone()
Returns a copy of this.
|
int |
cmp(int x)
Returns -1, 0, 1 if this is respectively strictly smaller, equal, or
strictly greater than x.
|
int |
cmp(MpfrScalar 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.
|
MpfrScalar |
copy()
Creates a copy of the Scalar, of the same kind.
|
Mpfr |
get()
Returns the underlying Mpfr.
|
int |
hashCode()
Returns a hash of the value of this.
|
void |
inv()
Inverts this (with rounding).
|
boolean |
isEqual(int x)
Whether this and x have the same value.
|
boolean |
isEqual(MpfrScalar 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,
int round)
Copies the value of x into this.
|
void |
set(int x)
Sets this to x.
|
void |
set(Mpfr x)
Copies the value of x into this.
|
void |
set(Mpfr x,
int round)
Copies the value of x into this.
|
void |
set(MpfrScalar x)
Copies the value of x into this.
|
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[0] (with rounding).
|
int |
toMpfr(Mpfr r,
int round)
Copies the value of this into r (exact).
|
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 Mpfr val
public MpfrScalar()
public MpfrScalar(int prec)
public MpfrScalar(MpfrScalar x)
public MpfrScalar(Mpfr x)
public MpfrScalar(double x, int round)
x is rounded to the default Mpfr precision
(see gmp.Mpfr.setDefaultPrec
)
in the direction specified by round.
public MpfrScalar copy()
Scalar
public void set(MpfrScalar x)
The precision of this is changed to match that of x.
public void set(Mpfr x)
The precision of this is changed to match that of x.
public void set(Mpfr x, int round)
this retains its precision and x is rounded.
public void set(double x, int round)
this retains its precision and x is rounded.
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 Mpfr 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(MpfrScalar x)
public int cmp(int x)
public int cmp(Scalar x)
public boolean isEqual(MpfrScalar x)
public boolean isEqual(int x)
public boolean isEqual(Scalar x)
public MpfrScalar clone()
clone
in class java.lang.Object