Class BigFloat.SpecialBigFloat
- All Implemented Interfaces:
Serializable
,Comparable<BigFloat>
- Enclosing class:
BigFloat
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class ch.obermuhlner.math.big.BigFloat
BigFloat.Context
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BigFloat.Context
private final BigFloat.SpecialBigFloat.Type
Fields inherited from class ch.obermuhlner.math.big.BigFloat
NaN, NEGATIVE_INFINITY, POSITIVE_INFINITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns theBigFloat
that isthis + x
.int
Returns theBigFloat
that isthis / x
.boolean
Returns theBigFloat.Context
ofthis
value.Returns the exponent ofthis
value written as mantissa * 10exponent.Returns the fractional part ofthis
value (right of the decimal point).Returns the integral part ofthis
value (left of the decimal point).Returns the mantissa ofthis
value written as mantissa * 10exponent.int
hashCode()
boolean
boolean
Returns whetherthis
value can be represented asint
.boolean
Returns whether thisBigFloat
is negative.boolean
Returns whether thisBigFloat
is positive.protected boolean
boolean
isZero()
Returns whether thisBigFloat
is 0.Returns theBigFloat
that isthis * x
.int
signum()
Returns the signum function of thisBigFloat
.Returns theBigFloat
that isthis - x
.Returns theBigFloat
that isthis - x
.Returnsthis
value as aBigDecimal
value.double
toDouble()
Returnsthis
value as adouble
value.int
toInt()
Returnsthis
value as aint
value.long
toLong()
Returnsthis
value as along
value.toString()
protected BigFloat.SpecialBigFloat.Type
type()
return special type of a valueMethods 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 Details
-
DUMMY_CONTEXT
-
type
-
-
Constructor Details
-
SpecialBigFloat
-
-
Method Details
-
isSpecial
protected boolean isSpecial() -
type
Description copied from class:BigFloat
return special type of a value- Overrides:
type
in classBigFloat
- Returns:
BigFloat.SpecialBigFloat.Type
-
add
Description copied from class:BigFloat
Returns theBigFloat
that isthis + x
.If the two values do not have the same
BigFloat.Context
, the result will contain theBigFloat.Context
with the larger precision. -
subtract
Description copied from class:BigFloat
Returns theBigFloat
that isthis - x
.If the two values do not have the same
BigFloat.Context
, the result will contain theBigFloat.Context
with the larger precision. -
subtract
Description copied from class:BigFloat
Returns theBigFloat
that isthis - x
. -
multiply
Description copied from class:BigFloat
Returns theBigFloat
that isthis * x
.If the two values do not have the same
BigFloat.Context
, the result will contain theBigFloat.Context
with the larger precision. -
divide
Description copied from class:BigFloat
Returns theBigFloat
that isthis / x
.If the two values do not have the same
BigFloat.Context
, the result will contain theBigFloat.Context
with the larger precision. -
remainder
Description copied from class:BigFloat
Returns theBigFloat
that is the remainder when dividingthis
byx
.If the two values do not have the same
BigFloat.Context
, the result will contain theBigFloat.Context
with the larger precision. -
pow
Description copied from class:BigFloat
Returns theBigFloat
that isthis
to the power ofy
.If the two values do not have the same
BigFloat.Context
, the result will contain theBigFloat.Context
with the larger precision. -
root
Description copied from class:BigFloat
Returns theBigFloat
that is they
th root ofthis
.If the two values do not have the same
BigFloat.Context
, the result will contain theBigFloat.Context
with the larger precision. -
hashCode
public int hashCode() -
equals
-
signum
public int signum()Description copied from class:BigFloat
Returns the signum function of thisBigFloat
.- Overrides:
signum
in classBigFloat
- Returns:
- -1, 0, or 1 as the value of this
BigDecimal
is negative, zero, or positive.
-
isNegative
public boolean isNegative()Description copied from class:BigFloat
Returns whether thisBigFloat
is negative.- Overrides:
isNegative
in classBigFloat
- Returns:
true
if negative,false
if 0 or positive
-
isZero
public boolean isZero()Description copied from class:BigFloat
Returns whether thisBigFloat
is 0. -
isPositive
public boolean isPositive()Description copied from class:BigFloat
Returns whether thisBigFloat
is positive.- Overrides:
isPositive
in classBigFloat
- Returns:
true
if positive,false
if 0 or negative
-
compareTo
- Specified by:
compareTo
in interfaceComparable<BigFloat>
- Overrides:
compareTo
in classBigFloat
-
isIntValue
public boolean isIntValue()Description copied from class:BigFloat
Returns whetherthis
value can be represented asint
.- Overrides:
isIntValue
in classBigFloat
- Returns:
true
if the value can be represented asint
value- See Also:
-
isDoubleValue
public boolean isDoubleValue()Description copied from class:BigFloat
- Overrides:
isDoubleValue
in classBigFloat
- Returns:
true
if the value can be represented asdouble
value- See Also:
-
getMantissa
Description copied from class:BigFloat
Returns the mantissa ofthis
value written as mantissa * 10exponent.The mantissa is defined as having exactly 1 digit before the decimal point.
- Overrides:
getMantissa
in classBigFloat
- Returns:
- the mantissa
- See Also:
-
getExponent
Description copied from class:BigFloat
Returns the exponent ofthis
value written as mantissa * 10exponent.The mantissa is defined as having exactly 1 digit before the decimal point.
- Overrides:
getExponent
in classBigFloat
- Returns:
- the exponent
- See Also:
-
getIntegralPart
Description copied from class:BigFloat
Returns the integral part ofthis
value (left of the decimal point).- Overrides:
getIntegralPart
in classBigFloat
- Returns:
- the integral part
- See Also:
-
getFractionalPart
Description copied from class:BigFloat
Returns the fractional part ofthis
value (right of the decimal point).- Overrides:
getFractionalPart
in classBigFloat
- Returns:
- the fractional part
- See Also:
-
getContext
Description copied from class:BigFloat
Returns theBigFloat.Context
ofthis
value.- Overrides:
getContext
in classBigFloat
- Returns:
- the
BigFloat.Context
-
toBigDecimal
Description copied from class:BigFloat
Returnsthis
value as aBigDecimal
value.- Overrides:
toBigDecimal
in classBigFloat
- Returns:
- the
BigDecimal
value
-
toDouble
public double toDouble()Description copied from class:BigFloat
Returnsthis
value as adouble
value. -
toLong
public long toLong()Description copied from class:BigFloat
Returnsthis
value as along
value. -
toInt
public int toInt()Description copied from class:BigFloat
Returnsthis
value as aint
value. -
toString
-