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 Details

    • ZERO

      static final Int ZERO
    • ONE

      static final Int ONE
    • NEGATIVE_ONE

      static final Int NEGATIVE_ONE
  • Method Details

    • arithmetic

      static Arithmetic<Int,Rational> arithmetic()
    • of

      static Int of(int value)
    • of

      static Int of(long value)
    • of

      static Int of(BigInteger value)
    • parse

      static Int parse(String number)
    • isNegativeOne

      boolean isNegativeOne()
    • abs

      default Int abs()
      Description copied from interface: Signed
      Returns the absolute value of this instance.
      Specified by:
      abs in interface AdditionGroup<Int>
      Specified by:
      abs in interface Signed<Int>
      Returns:
      Signed.negate() when this value is negative; otherwise this instance
    • plus

      default Int plus(long other)
    • plus

      default Int plus(int other)
    • minus

      default Int minus(Int other)
      Specified by:
      minus in interface AdditionGroup<Int>
    • minus

      default Int minus(long other)
    • minus

      default Int minus(int other)
    • times

      default Int times(long other)
    • times

      default Int times(int other)
    • over

      default Rational over(Int other)
    • over

      default Rational over(long other)
    • over

      default Rational over(int other)
    • toBigInteger

      BigInteger toBigInteger()
    • square

      Int square()
    • cube

      Int cube()
    • toBigDecimal

      BigDecimal toBigDecimal()
    • toLong

      long toLong()
    • toInt

      int toInt()
    • toRational

      Rational toRational()
    • raisedTo

      default Int raisedTo(int exponent)
    • divideAndRemainder

      default DividerAndRemainder<Int> divideAndRemainder(Int other)
    • gcd

      Int gcd(Int other)
    • increment

      Int increment()
    • decrement

      Int decrement()
    • isZero

      boolean isZero()
      Description copied from interface: Signed
      Tests if this value is zero.
      Specified by:
      isZero in interface AdditionMonoid<Int>
      Specified by:
      isZero in interface Signed<Int>
      Returns:
      true if Signed.sign() returns 0; false otherwise