Package ch.obermuhlner.math.big
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 MathContext
final BigFloat
final BigFloat
private static final long
final BigFloat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptione()
Returns the constant e with this context.boolean
factorial
(int n) Returns the factorial of n with this context.Returns theMathContext
of this context.int
Returns the precision of this context.Returns theRoundingMode
of this context.int
hashCode()
pi()
Returns the constant pi with this context.toString()
valueOf
(double value) Creates aBigFloat
value with this context.valueOf
(int value) Creates aBigFloat
value with this context.valueOf
(int value, boolean unsigned) parse unsigned value with this logicvalueOf
(long value) Creates aBigFloat
value with this context.valueOf
(long value, boolean unsigned) parse unsigned value with this logicCreates aBigFloat
value with this context.Creates aBigFloat
value with this context.valueOf
(BigDecimal value) Creates aBigFloat
value 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 theMathContext
of 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 theRoundingMode
of this context.This is equivalent to calling
getMathContext().getRoundingMode()
.- Returns:
- the
RoundingMode
-
valueOf
Creates aBigFloat
value with this context. -
valueOf
Creates aBigFloat
value with this context.- Parameters:
value
- the sourceBigDecimal
value- Returns:
- the
BigFloat
value with this context (rounded to the precision of this context)
-
valueOf
Creates aBigFloat
value with this context.- Parameters:
value
- the source int value- Returns:
- the
BigFloat
value with this context (rounded to the precision of this context)
-
valueOf
parse unsigned value with this logicvalue & 4294967295
- Parameters:
value
- an int valueunsigned
- if true value will parse as unsigned integer- Returns:
- the
BigFloat
value with this context (rounded to the precision of this context)
-
valueOf
Creates aBigFloat
value with this context.- Parameters:
value
- the source long value- Returns:
- the
BigFloat
value with this context (rounded to the precision of this context)
-
valueOf
parse unsigned value with this logicvalue & 18446744073709551615
- Parameters:
value
- an int valueunsigned
- if true value will parse as unsigned integer- Returns:
- the
BigFloat
value with this context (rounded to the precision of this context)
-
valueOf
Creates aBigFloat
value with this context.- Parameters:
value
- the source double value- Returns:
- the
BigFloat
value with this context (rounded to the precision of this context)
-
valueOf
Creates aBigFloat
value with this context.- Parameters:
value
- the source String value- Returns:
- the
BigFloat
value 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
public int hashCode() -
equals
-
toString
-