StrictlyNegativeInt

@Serializable(with = StrictlyNegativeIntSerializer::class)
interface StrictlyNegativeInt : NonZeroInt, NegativeInt

Deprecated

Use the kotools.types.StrictlyNegativeInt type instead.

Replace with

import kotools.types.StrictlyNegativeInt
StrictlyNegativeInt

Representation of strictly negative integers, excluding zero.

Types

Link copied to clipboard
object Companion

Contains declarations for holding or building a StrictlyPositiveInt.

Link copied to clipboard

Error thrown when creating a StrictlyNegativeInt fails.

Functions

Link copied to clipboard
open operator fun compareTo(other: Int): Int
open operator override fun compareTo(other: IntHolder): Int

Compares this value with the other value for order. Returns zero if this value equals the other value, a negative number if this value is less than the other value, or a positive number if this value is greater than the other value.

Link copied to clipboard
open operator override fun dec(): StrictlyNegativeInt

Returns this value decremented by one. If this value equals 1, it returns -1 instead. If this value is the minimum, it returns the maximum value instead.

Link copied to clipboard
open operator fun div(other: NonZeroInt): Int

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

open operator fun div(other: StrictlyNegativeInt): PositiveInt
open operator fun div(other: StrictlyPositiveInt): NegativeInt

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

Link copied to clipboard
open operator override fun inc(): StrictlyNegativeInt

Returns this value incremented by one. If this value equals -1, it returns 1 instead. If this value is the maximum, it returns the minimum value instead.

Link copied to clipboard
open operator fun minus(other: Int): Int
open operator fun minus(other: IntHolder): Int

Subtracts the other value from this value.

Link copied to clipboard
open operator fun plus(other: Int): Int
open operator fun plus(other: IntHolder): Int

Adds the other value to this value.

Link copied to clipboard
open operator fun times(other: Int): Int
open operator fun times(other: IntHolder): Int

Multiplies this value by the other value.

open operator fun times(other: NonZeroInt): NonZeroInt

Multiplies this value by the other value.

Link copied to clipboard
open operator override fun unaryMinus(): StrictlyPositiveInt

Returns the negative of this value.

Properties

Link copied to clipboard
abstract val value: Int

The value to hold.