Class BigFloat.Context
java.lang.Object
ch.obermuhlner.math.big.BigFloat.Context
- All Implemented Interfaces:
Serializable
- Enclosing class:
BigFloat
Manages the
MathContext and provides factory methods for BigFloat values.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MathContextfinal BigFloatfinal BigFloatprivate static final longfinal BigFloat -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptione()Returns the constant e with this context.booleanfactorial(int n) Returns the factorial of n with this context.Returns theMathContextof this context.intReturns the precision of this context.Returns theRoundingModeof this context.inthashCode()pi()Returns the constant pi with this context.toString()valueOf(double value) Creates aBigFloatvalue with this context.valueOf(int value) Creates aBigFloatvalue with this context.valueOf(int value, boolean unsigned) parse unsigned value with this logicvalueOf(long value) Creates aBigFloatvalue with this context.valueOf(long value, boolean unsigned) parse unsigned value with this logicCreates aBigFloatvalue with this context.Creates aBigFloatvalue with this context.valueOf(BigDecimal value) Creates aBigFloatvalue with this context.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
NEGATIVE_ONE
-
ZERO
-
ONE
-
mathContext
-
-
Constructor Details
-
Context
-
-
Method Details
-
getMathContext
Returns theMathContextof this context.- Returns:
- the
MathContext
-
getPrecision
public int getPrecision()Returns the precision of this context.This is equivalent to calling
getMathContext().getPrecision().- Returns:
- the precision
-
getRoundingMode
Returns theRoundingModeof this context.This is equivalent to calling
getMathContext().getRoundingMode().- Returns:
- the
RoundingMode
-
valueOf
-
valueOf
Creates aBigFloatvalue with this context.- Parameters:
value- the sourceBigDecimalvalue- Returns:
- the
BigFloatvalue with this context (rounded to the precision of this context)
-
valueOf
-
valueOf
-
valueOf
-
valueOf
-
valueOf
-
valueOf
Creates aBigFloatvalue with this context.- Parameters:
value- the source String value- Returns:
- the
BigFloatvalue with this context (rounded to the precision of this context) - Throws:
NumberFormatException- if the value is not a valid number.
-
pi
Returns the constant pi with this context.- Returns:
- pi with this context (rounded to the precision of this context)
- See Also:
-
e
Returns the constant e with this context.- Returns:
- e with this context (rounded to the precision of this context)
- See Also:
-
factorial
Returns the factorial of n with this context.- Parameters:
n- the value to calculate- Returns:
- the factorial of n with this context (rounded to the precision of this context)
- See Also:
-
hashCode
-
equals
-
toString
-