Skip to content

SW-25 Maths - new methods #41

@lstypka

Description

@lstypka

// For all number types!

  • sequence(start, stop, step)
  • sequence(start, stop, interface satisfies { boolean satisfies(...) {} });
  • adjustToRange(value, min, max, Range.LEFT_CLOSED, RIGHT_CLOSED, BOTH_CLOSED)
  • byte : add with saturation ( byte, byte) // 120 + 5 = 125; 125+5 = 127; 127+1 = 127 etc
  • byte: wrapTo(byte, byte, byte startingNumber) // startingNumber: 100 => 120+5 = 125; 125+5 = 102, 102 + 30 = 105
  • random for BigInteger
  • random for BigDecimal
  • isZero(BigInteger)
  • isZero(BigDecimal)
  • isPositive(BigInteger)
  • isPositive(BigDecimal)
  • isNegative(BigInteger)
  • isNegative(BigDecimal)
  • mathematics methods for BigInteger BigDecimal (sqrt, etc ... )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions