Class BigFloat.SpecialBigFloat
- java.lang.Object
-
- ch.obermuhlner.math.big.BigFloat
-
- ch.obermuhlner.math.big.BigFloat.SpecialBigFloat
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classBigFloat.SpecialBigFloat.Type-
Nested classes/interfaces inherited from class ch.obermuhlner.math.big.BigFloat
BigFloat.Context
-
-
Field Summary
Fields Modifier and Type Field Description private static BigFloat.ContextDUMMY_CONTEXTprivate BigFloat.SpecialBigFloat.Typetype-
Fields inherited from class ch.obermuhlner.math.big.BigFloat
NaN, NEGATIVE_INFINITY, POSITIVE_INFINITY
-
-
Constructor Summary
Constructors Modifier Constructor Description privateSpecialBigFloat(BigFloat.SpecialBigFloat.Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BigFloatadd(BigFloat x)Returns theBigFloatthat isthis + x.intcompareTo(BigFloat other)BigFloatdivide(BigFloat x)Returns theBigFloatthat isthis / x.booleanequals(java.lang.Object obj)BigFloat.ContextgetContext()Returns theBigFloat.Contextofthisvalue.BigFloatgetExponent()Returns the exponent ofthisvalue written as mantissa * 10exponent.BigFloatgetFractionalPart()Returns the fractional part ofthisvalue (right of the decimal point).BigFloatgetIntegralPart()Returns the integral part ofthisvalue (left of the decimal point).BigFloatgetMantissa()Returns the mantissa ofthisvalue written as mantissa * 10exponent.inthashCode()booleanisDoubleValue()Returns whetherthisspecifiedBigDecimalvalue can be represented asdouble.booleanisIntValue()Returns whetherthisvalue can be represented asint.booleanisNegative()Returns whether thisBigFloatis negative.booleanisPositive()Returns whether thisBigFloatis positive.protected booleanisSpecial()booleanisZero()Returns whether thisBigFloatis 0.BigFloatmultiply(BigFloat x)Returns theBigFloatthat isthis * x.BigFloatpow(BigFloat y)BigFloatremainder(BigFloat x)BigFloatroot(BigFloat y)intsignum()Returns the signum function of thisBigFloat.BigFloatsubtract(BigFloat x)Returns theBigFloatthat isthis - x.BigFloatsubtract(java.math.BigDecimal x)Returns theBigFloatthat isthis - x.java.math.BigDecimaltoBigDecimal()Returnsthisvalue as aBigDecimalvalue.doubletoDouble()Returnsthisvalue as adoublevalue.inttoInt()Returnsthisvalue as aintvalue.longtoLong()Returnsthisvalue as alongvalue.java.lang.StringtoString()protected BigFloat.SpecialBigFloat.Typetype()return special type of a value-
Methods inherited from class ch.obermuhlner.math.big.BigFloat
abs, acos, acosh, acot, acoth, add, add, add, add, asin, asinh, atan, atanh, context, context, cos, cosh, cot, coth, divide, divide, divide, divide, exp, isBetween, isEqual, isGreaterThan, isGreaterThanOrEqual, isInfinity, isLessThan, isLessThanOrEqual, isNaN, log, log10, log2, max, max, min, min, multiply, multiply, multiply, multiply, negate, pow, pow, pow, pow, pow, remainder, remainder, remainder, remainder, root, root, root, root, root, sin, sinh, sqrt, subtract, subtract, subtract, tan, tanh
-
-
-
-
Field Detail
-
DUMMY_CONTEXT
private static final BigFloat.Context DUMMY_CONTEXT
-
type
private final BigFloat.SpecialBigFloat.Type type
-
-
Constructor Detail
-
SpecialBigFloat
private SpecialBigFloat(BigFloat.SpecialBigFloat.Type type)
-
-
Method Detail
-
type
protected BigFloat.SpecialBigFloat.Type type()
Description copied from class:BigFloatreturn special type of a value- Overrides:
typein classBigFloat- Returns:
BigFloat.SpecialBigFloat.Type
-
add
public BigFloat add(BigFloat x)
Description copied from class:BigFloatReturns theBigFloatthat isthis + x.If the two values do not have the same
BigFloat.Context, the result will contain theBigFloat.Contextwith the larger precision.
-
subtract
public BigFloat subtract(BigFloat x)
Description copied from class:BigFloatReturns theBigFloatthat isthis - x.If the two values do not have the same
BigFloat.Context, the result will contain theBigFloat.Contextwith the larger precision.
-
subtract
public BigFloat subtract(java.math.BigDecimal x)
Description copied from class:BigFloatReturns theBigFloatthat isthis - x.
-
multiply
public BigFloat multiply(BigFloat x)
Description copied from class:BigFloatReturns theBigFloatthat isthis * x.If the two values do not have the same
BigFloat.Context, the result will contain theBigFloat.Contextwith the larger precision.
-
divide
public BigFloat divide(BigFloat x)
Description copied from class:BigFloatReturns theBigFloatthat isthis / x.If the two values do not have the same
BigFloat.Context, the result will contain theBigFloat.Contextwith the larger precision.
-
remainder
public BigFloat remainder(BigFloat x)
Description copied from class:BigFloatReturns theBigFloatthat is the remainder when dividingthisbyx.If the two values do not have the same
BigFloat.Context, the result will contain theBigFloat.Contextwith the larger precision.
-
pow
public BigFloat pow(BigFloat y)
Description copied from class:BigFloatReturns theBigFloatthat isthisto the power ofy.If the two values do not have the same
BigFloat.Context, the result will contain theBigFloat.Contextwith the larger precision.- Overrides:
powin classBigFloat- Parameters:
y- the value of the power- Returns:
- the resulting
BigFloat - See Also:
BigDecimalMath.pow(BigDecimal, BigDecimal, MathContext)
-
root
public BigFloat root(BigFloat y)
Description copied from class:BigFloatReturns theBigFloatthat is theyth root ofthis.If the two values do not have the same
BigFloat.Context, the result will contain theBigFloat.Contextwith the larger precision.- Overrides:
rootin classBigFloat- Parameters:
y- the value of the root- Returns:
- the resulting
BigFloat - See Also:
BigDecimalMath.root(BigDecimal, BigDecimal, MathContext)
-
signum
public int signum()
Description copied from class:BigFloatReturns the signum function of thisBigFloat.
-
isNegative
public boolean isNegative()
Description copied from class:BigFloatReturns whether thisBigFloatis negative.- Overrides:
isNegativein classBigFloat- Returns:
trueif negative,falseif 0 or positive
-
isZero
public boolean isZero()
Description copied from class:BigFloatReturns whether thisBigFloatis 0.
-
isPositive
public boolean isPositive()
Description copied from class:BigFloatReturns whether thisBigFloatis positive.- Overrides:
isPositivein classBigFloat- Returns:
trueif positive,falseif 0 or negative
-
compareTo
public int compareTo(BigFloat other)
-
isIntValue
public boolean isIntValue()
Description copied from class:BigFloatReturns whetherthisvalue can be represented asint.- Overrides:
isIntValuein classBigFloat- Returns:
trueif the value can be represented asintvalue- See Also:
BigDecimalMath.isIntValue(BigDecimal)
-
isDoubleValue
public boolean isDoubleValue()
Description copied from class:BigFloatReturns whetherthisspecifiedBigDecimalvalue can be represented asdouble.- Overrides:
isDoubleValuein classBigFloat- Returns:
trueif the value can be represented asdoublevalue- See Also:
BigDecimalMath.isDoubleValue(BigDecimal)
-
getMantissa
public BigFloat getMantissa()
Description copied from class:BigFloatReturns the mantissa ofthisvalue written as mantissa * 10exponent.The mantissa is defined as having exactly 1 digit before the decimal point.
- Overrides:
getMantissain classBigFloat- Returns:
- the mantissa
- See Also:
BigFloat.getExponent(),BigDecimalMath.mantissa(BigDecimal)
-
getExponent
public BigFloat getExponent()
Description copied from class:BigFloatReturns the exponent ofthisvalue written as mantissa * 10exponent.The mantissa is defined as having exactly 1 digit before the decimal point.
- Overrides:
getExponentin classBigFloat- Returns:
- the exponent
- See Also:
BigFloat.getMantissa(),BigDecimalMath.exponent(BigDecimal)
-
getIntegralPart
public BigFloat getIntegralPart()
Description copied from class:BigFloatReturns the integral part ofthisvalue (left of the decimal point).- Overrides:
getIntegralPartin classBigFloat- Returns:
- the integral part
- See Also:
BigFloat.getFractionalPart(),BigDecimalMath.fractionalPart(BigDecimal)
-
getFractionalPart
public BigFloat getFractionalPart()
Description copied from class:BigFloatReturns the fractional part ofthisvalue (right of the decimal point).- Overrides:
getFractionalPartin classBigFloat- Returns:
- the fractional part
- See Also:
BigFloat.getIntegralPart(),BigDecimalMath.fractionalPart(BigDecimal)
-
getContext
public BigFloat.Context getContext()
Description copied from class:BigFloatReturns theBigFloat.Contextofthisvalue.- Overrides:
getContextin classBigFloat- Returns:
- the
BigFloat.Context
-
toBigDecimal
public java.math.BigDecimal toBigDecimal()
Description copied from class:BigFloatReturnsthisvalue as aBigDecimalvalue.- Overrides:
toBigDecimalin classBigFloat- Returns:
- the
BigDecimalvalue
-
toDouble
public double toDouble()
Description copied from class:BigFloatReturnsthisvalue as adoublevalue.
-
toLong
public long toLong()
Description copied from class:BigFloatReturnsthisvalue as alongvalue.
-
toInt
public int toInt()
Description copied from class:BigFloatReturnsthisvalue as aintvalue.
-
-