StrictlyPositiveInt

@Serializable(with = StrictlyPositiveIntSerializer::class)
@SinceKotoolsTypes(version = "1.1")
value class StrictlyPositiveInt : NonZeroInt, PositiveInt

Representation of positive integers excluding zero.

Types

Link copied to clipboard
object Companion

Contains declarations for holding or building a StrictlyPositiveInt.

Functions

Link copied to clipboard
@SinceKotoolsTypes(version = "4.1")
open infix operator override fun compareTo(other: AnyInt): Int

Compares this integer with the other one for order. Returns zero if this integer equals the other one, a negative number if it's less than the other one, or a positive number if it's greater than the other one.

Link copied to clipboard
@SinceKotoolsTypes(version = "4.0")
open override fun toInt(): Int

Returns this integer as an Int.

Link copied to clipboard
@SinceKotoolsTypes(version = "4.0")
open override fun toString(): String

Returns the string representation of this integer.

Extensions

Link copied to clipboard
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.div(other: NonZeroInt): Int
@SinceKotoolsTypes(version = "4.1")
operator fun PositiveInt.div(other: StrictlyPositiveInt): PositiveInt
@SinceKotoolsTypes(version = "4.1")
operator fun PositiveInt.div(other: StrictlyNegativeInt): NegativeInt

Divides this integer by the other one, truncating the result to an integer that is closer to zero.

Link copied to clipboard
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.minus(other: Int): Int
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.minus(other: AnyInt): Int

Subtracts the other integer from this one.

Link copied to clipboard
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.plus(other: Int): Int
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.plus(other: AnyInt): Int

Adds the other integer to this one.

Link copied to clipboard
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.rem(other: NonZeroInt): Int
@SinceKotoolsTypes(version = "4.1")
operator fun PositiveInt.rem(other: NonZeroInt): PositiveInt

Calculates the remainder of truncating division of this integer by the other one.

Link copied to clipboard
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.times(other: Int): Int
@SinceKotoolsTypes(version = "4.1")
operator fun AnyInt.times(other: AnyInt): Int

Multiplies this integer by the other one.

Link copied to clipboard
@ExperimentalSinceKotoolsTypes(version = "4.2")
operator fun StrictlyPositiveInt.unaryMinus(): StrictlyNegativeInt
@ExperimentalSinceKotoolsTypes(version = "4.2")
operator fun NonZeroInt.unaryMinus(): NonZeroInt
@ExperimentalSinceKotoolsTypes(version = "4.2")
operator fun AnyInt.unaryMinus(): Int
@ExperimentalSinceKotoolsTypes(version = "4.2")
operator fun PositiveInt.unaryMinus(): NegativeInt

Returns the negative of this integer.