public final class BigNumber extends Number
Modifier and Type | Field and Description |
---|---|
static BigNumber |
BIG_NUMBER_ONE |
static BigNumber |
BIG_NUMBER_ZERO
Statics for 0 and 1.
|
static BigNumber |
NaN |
static BigNumber |
NEGATIVE_INFINITY
Statics for negative infinity, positive infinity and NaN.
|
static BigNumber |
POSITIVE_INFINITY |
Modifier and Type | Method and Description |
---|---|
BigNumber |
abs() |
BigNumber |
add(BigNumber number) |
BigDecimal |
asBigDecimal()
Returns the big number as a BigDecimal object.
|
BigNumber |
bitWiseOr(BigNumber number) |
byte |
byteValue()
Returns this big number as a byte.
|
boolean |
canBeRepresentedAsInt()
Returns true if this BigNumber can be represented by a 32-bit int (has
no scale).
|
boolean |
canBeRepresentedAsLong()
Returns true if this BigNumber can be represented by a 64-bit long (has
no scale).
|
int |
compareTo(BigNumber number)
Compares this BigNumber with the given BigNumber.
|
BigNumber |
divide(BigNumber number) |
double |
doubleValue()
Returns this big number as a double.
|
boolean |
equals(Object ob)
The equals comparison uses the BigDecimal 'equals' method to compare
values.
|
float |
floatValue()
Returns this big number as a float.
|
static BigNumber |
fromBigDecimal(BigDecimal val)
Creates a BigNumber from a BigDecimal.
|
static BigNumber |
fromData(byte[] buf,
int scale,
byte state)
Creates a BigNumber from the given data.
|
static BigNumber |
fromDouble(double value)
Creates a BigNumber from a double.
|
static BigNumber |
fromFloat(float value)
Creates a BigNumber from a float.
|
static BigNumber |
fromInt(int value)
Creates a BigNumber from an int.
|
static BigNumber |
fromLong(long value)
Creates a BigNumber from a long.
|
static BigNumber |
fromString(String str)
Creates a BigNumber from a string.
|
int |
getScale()
Returns the scale of this number, or -1 if the number has no scale (if
it -inf, +inf or NaN).
|
byte |
getState()
Returns the state of this number.
|
int |
intValue()
Returns this big number as an int.
|
long |
longValue()
Returns this big number as a long.
|
BigNumber |
multiply(BigNumber number) |
BigNumber |
setScale(int d,
int round_enum) |
short |
shortValue()
Returns this big number as a short.
|
int |
signum() |
BigNumber |
sqrt() |
BigNumber |
subtract(BigNumber number) |
byte[] |
toByteArray()
Returns this number as a byte array (unscaled).
|
String |
toString()
Returns this big number as a string.
|
public static final BigNumber NEGATIVE_INFINITY
public static final BigNumber POSITIVE_INFINITY
public static final BigNumber NaN
public static final BigNumber BIG_NUMBER_ZERO
public static final BigNumber BIG_NUMBER_ONE
public boolean canBeRepresentedAsLong()
public boolean canBeRepresentedAsInt()
public int getScale()
public byte getState()
public byte[] toByteArray()
public String toString()
public double doubleValue()
doubleValue
in class Number
public float floatValue()
floatValue
in class Number
public long longValue()
public int intValue()
public short shortValue()
shortValue
in class Number
public byte byteValue()
public BigDecimal asBigDecimal()
public int compareTo(BigNumber number)
public boolean equals(Object ob)
public BigNumber abs()
public int signum()
public BigNumber setScale(int d, int round_enum)
public BigNumber sqrt()
public static BigNumber fromDouble(double value)
public static BigNumber fromFloat(float value)
public static BigNumber fromLong(long value)
public static BigNumber fromInt(int value)
public static BigNumber fromBigDecimal(BigDecimal val)
public static BigNumber fromData(byte[] buf, int scale, byte state)
Copyright © 2015. All rights reserved.