Package org.zfcj.math.numbers
Interface IrrationalNumber<N extends PositiveInteger>
- Type Parameters:
N
- the type of the precision
- All Superinterfaces:
Comparable<RealNumber>
,Number
,RealNumber
An
IrrationalNumber
is a RealNumber
that is not a
RationalNumber
. IrrationalNumber
s can not be represented
precisely and rely on approximation for computation.-
Method Summary
Modifier and TypeMethodDescriptiondefault int
default MathContext
context()
Returns theMathContext
used for someBigDecimal
calculationsdefault boolean
isDouble()
Determines if thisRealNumber
's value has the precision of a primitive doubleMethods inherited from interface org.zfcj.math.numbers.RealNumber
abs, almostEquals, almostEquals, bigDecimalValue, dividedBy, doubleValue, greaterThan, greaterThanOrEqualTo, lessThan, lessThanOrEqualTo, minus, modulo, plus, pow, times, truncate
-
Method Details
-
precision
N precision()- Returns:
- the precision N
-
isDouble
default boolean isDouble()Description copied from interface:RealNumber
Determines if thisRealNumber
's value has the precision of a primitive double- Specified by:
isDouble
in interfaceRealNumber
- Returns:
- true if this
RealNumber
is double precision, false, if BigDecimal precision
-
compareTo
- Specified by:
compareTo
in interfaceComparable<N extends PositiveInteger>
- Specified by:
compareTo
in interfaceRealNumber
-
context
Returns theMathContext
used for someBigDecimal
calculations- Returns:
- a MathContext
-