Package org.midheaven.math
Interface Int
- All Superinterfaces:
AdditionGroup<Int>,AdditionMonoid<Int>,Comparable<Int>,LongOrdered,MultiplicationMonoid<Int>,Ordered<Int>,Signed<Int>
public sealed interface Int
extends Ordered<Int>, LongOrdered, Signed<Int>, AdditionGroup<Int>, MultiplicationMonoid<Int>
Defines the contract for Int.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault Intabs()Returns the absolute value of this instance.static Arithmetic<Int, Rational> cube()default DividerAndRemainder<Int> divideAndRemainder(Int other) booleanbooleanisZero()Tests if this value is zero.default Intminus(int other) default Intminus(long other) default Intstatic Intof(int value) static Intof(long value) static Intof(BigInteger value) default Rationalover(int other) default Rationalover(long other) default Rationalstatic Intdefault Intplus(int other) default Intplus(long other) default IntraisedTo(int exponent) square()default Inttimes(int other) default Inttimes(long other) inttoInt()longtoLong()Methods inherited from interface org.midheaven.math.AdditionGroup
negateMethods inherited from interface org.midheaven.math.AdditionMonoid
plusMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.midheaven.lang.LongOrdered
compareTo, isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualToMethods inherited from interface org.midheaven.math.MultiplicationMonoid
isOne, timesMethods inherited from interface org.midheaven.lang.Ordered
isEqualTo, isGreaterThan, isGreaterThanOrEqualTo, isLessThan, isLessThanOrEqualToMethods inherited from interface org.midheaven.lang.Signed
isNegative, isPositive, negate, sign
-
Field Details
-
ZERO
-
ONE
-
NEGATIVE_ONE
-
-
Method Details
-
arithmetic
-
of
-
of
-
of
-
parse
-
isNegativeOne
boolean isNegativeOne() -
abs
Description copied from interface:SignedReturns the absolute value of this instance.- Specified by:
absin interfaceAdditionGroup<Int>- Specified by:
absin interfaceSigned<Int>- Returns:
Signed.negate()when this value is negative; otherwise this instance
-
plus
-
plus
-
minus
- Specified by:
minusin interfaceAdditionGroup<Int>
-
minus
-
minus
-
times
-
times
-
over
-
over
-
over
-
toBigInteger
BigInteger toBigInteger() -
square
Int square() -
cube
Int cube() -
toBigDecimal
BigDecimal toBigDecimal() -
toLong
long toLong() -
toInt
int toInt() -
toRational
Rational toRational() -
raisedTo
-
divideAndRemainder
-
gcd
-
increment
Int increment() -
decrement
Int decrement() -
isZero
boolean isZero()Description copied from interface:SignedTests if this value is zero.- Specified by:
isZeroin interfaceAdditionMonoid<Int>- Specified by:
isZeroin interfaceSigned<Int>- Returns:
trueifSigned.sign()returns0;falseotherwise
-