public static class BigFloat.Context
extends java.lang.Object
implements java.io.Serializable
MathContext and provides factory methods for BigFloat values.| Modifier and Type | Field and Description |
|---|---|
BigFloat |
NEGATIVE_ONE |
BigFloat |
ONE |
BigFloat |
ZERO |
| Modifier and Type | Method and Description |
|---|---|
BigFloat |
e()
Returns the constant e with this context.
|
boolean |
equals(java.lang.Object obj) |
BigFloat |
factorial(int n)
Returns the factorial of n with this context.
|
java.math.MathContext |
getMathContext()
Returns the
MathContext of this context. |
int |
getPrecision()
Returns the precision of this context.
|
java.math.RoundingMode |
getRoundingMode()
Returns the
RoundingMode of this context. |
int |
hashCode() |
BigFloat |
pi()
Returns the constant pi with this context.
|
java.lang.String |
toString() |
BigFloat |
valueOf(java.math.BigDecimal value)
Creates a
BigFloat value with this context. |
BigFloat |
valueOf(BigFloat value)
Creates a
BigFloat value with this context. |
BigFloat |
valueOf(double value)
Creates a
BigFloat value with this context. |
BigFloat |
valueOf(int value)
Creates a
BigFloat value with this context. |
BigFloat |
valueOf(int value,
boolean unsigned)
parse unsigned value with this logic
value & 4294967295 |
BigFloat |
valueOf(long value)
Creates a
BigFloat value with this context. |
BigFloat |
valueOf(long value,
boolean unsigned)
parse unsigned value with this logic
value & 18446744073709551615 |
BigFloat |
valueOf(java.lang.String value)
Creates a
BigFloat value with this context. |
public final BigFloat NEGATIVE_ONE
public final BigFloat ZERO
public final BigFloat ONE
public java.math.MathContext getMathContext()
MathContext of this context.MathContextpublic int getPrecision()
This is equivalent to calling getMathContext().getPrecision().
public java.math.RoundingMode getRoundingMode()
RoundingMode of this context.
This is equivalent to calling getMathContext().getRoundingMode().
RoundingModepublic BigFloat valueOf(java.math.BigDecimal value)
BigFloat value with this context.value - the source BigDecimal valueBigFloat value with this context (rounded to the precision of this context)public BigFloat valueOf(int value)
BigFloat value with this context.value - the source int valueBigFloat value with this context (rounded to the precision of this context)public BigFloat valueOf(int value, boolean unsigned)
value & 4294967295value - an int valueunsigned - if true value will parse as unsigned integerBigFloat value with this context (rounded to the precision of this context)public BigFloat valueOf(long value)
BigFloat value with this context.value - the source long valueBigFloat value with this context (rounded to the precision of this context)public BigFloat valueOf(long value, boolean unsigned)
value & 18446744073709551615value - an int valueunsigned - if true value will parse as unsigned integerBigFloat value with this context (rounded to the precision of this context)public BigFloat valueOf(double value)
BigFloat value with this context.value - the source double valueBigFloat value with this context (rounded to the precision of this context)public BigFloat valueOf(java.lang.String value)
BigFloat value with this context.value - the source String valueBigFloat value with this context (rounded to the precision of this context)java.lang.NumberFormatException - if the value is not a valid number.public BigFloat pi()
BigDecimalMath.pi(MathContext)public BigFloat e()
BigDecimalMath.e(MathContext)public BigFloat factorial(int n)
n - the value to calculateBigDecimalMath.factorial(int)public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object