Int (original) (raw)
Represents a 32-bit signed integer.
Since Kotlin
1.0
Represents a 32-bit signed integer.
Since Kotlin
1.1
Represents a 32-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type int
.
Since Kotlin
1.0
Represents a 32-bit signed integer.
Since Kotlin
1.3
Represents a 32-bit signed integer.
Since Kotlin
1.8
Represents a 32-bit signed integer.
Since Kotlin
1.8
Types
Properties
Returns the absolute value of this value.
Returns the absolute value of this value.
Returns the absolute value of this value.
Returns the absolute value of this value.
Returns the absolute value of this value.
Returns the absolute value of this value.
Returns a Duration equal to this Int number of microseconds.
Returns a Duration equal to this Int number of milliseconds.
Returns a Duration equal to this Int number of minutes.
Returns a Duration equal to this Int number of nanoseconds.
Returns a Duration equal to this Int number of seconds.
Returns the sign of this value:
Returns the sign of this value:
Returns the sign of this value:
Returns the sign of this value:
Returns the sign of this value:
Returns the sign of this value:
Functions
expect infix fun and(other: Int): Int
Performs a bitwise AND operation between the two values.
actual infix fun and(other: Int): Int
Performs a bitwise AND operation between the two values.
Performs a bitwise AND operation between the two values.
actual infix external fun and(other: Int): Int
Performs a bitwise AND operation between the two values.
actual infix fun and(other: Int): Int
Performs a bitwise AND operation between the two values.
actual infix fun and(other: Int): Int
Performs a bitwise AND operation between the two values.
Ensures that this value is not less than the specified minimumValue.
Ensures that this value is not greater than the specified maximumValue.
Ensures that this value lies in the specified range.
Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.
Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.
Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.
actual open operator external override fun compareTo(other: Int): Int
Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.
actual open inline operator override fun compareTo(other: Int): Int
Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.
actual open inline operator override fun compareTo(other: Int): Int
Compares this value with the specified value for order. Returns zero if this value is equal to the specified other value, a negative number if it's less than other, or a positive number if it's greater than other.
Compares this object with the specified object for order. Returns zero if this object is equal to the specified other object, a negative number if it's less than other, or a positive number if it's greater than other.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Int number.
Counts the number of set bits in the binary representation of this Int number.
Counts the number of set bits in the binary representation of this Int number.
Counts the number of set bits in the binary representation of this Int number.
Counts the number of set bits in the binary representation of this Int number.
Counts the number of set bits in the binary representation of this Int number.
Counts the number of set bits in the binary representation of this Int number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Int number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Int number.
expect operator fun dec(): Int
Returns this value decremented by one.
actual operator fun dec(): Int
Returns this value decremented by one.
Returns this value decremented by one.
actual operator external fun dec(): Int
Returns this value decremented by one.
actual operator fun dec(): Int
Returns this value decremented by one.
actual operator fun dec(): Int
Returns this value decremented by one.
Returns the Char that represents this decimal digit. Throws an exception if this value is not in the range 0..9
.
Returns the Char that represents this numeric digit value in the specified radix. Throws an exception if the radix is not in the range 2..36
or if this value is not in the range 0 until radix
.
expect operator fun div(other: Byte): Int
expect operator fun div(other: Int): Int
Divides this value by the other value, truncating the result to an integer that is closer to zero.
Divides this value by the other value.
actual operator fun div(other: Byte): Int
actual operator fun div(other: Int): Int
Divides this value by the other value, truncating the result to an integer that is closer to zero.
Divides this value by the other value.
Divides this value by the other value, truncating the result to an integer that is closer to zero.
Divides this value by the other value.
actual inline operator fun div(other: Byte): Int
actual operator external fun div(other: Int): Int
actual inline operator fun div(other: Long): Long
actual inline operator fun div(other: Short): Int
Divides this value by the other value, truncating the result to an integer that is closer to zero.
Divides this value by the other value.
actual inline operator fun div(other: Byte): Int
actual operator fun div(other: Int): Int
actual inline operator fun div(other: Long): Long
actual inline operator fun div(other: Short): Int
Divides this value by the other value, truncating the result to an integer that is closer to zero.
Divides this value by the other value.
actual inline operator fun div(other: Byte): Int
actual operator fun div(other: Int): Int
actual inline operator fun div(other: Long): Long
actual inline operator fun div(other: Short): Int
Divides this value by the other value, truncating the result to an integer that is closer to zero.
Divides this value by the other value.
Returns a progression from this value down to and including the specified to value with the step -1.
Divides this value by the other value, flooring the result to an integer that is closer to negative infinity.
expect operator fun inc(): Int
Returns this value incremented by one.
actual operator fun inc(): Int
Returns this value incremented by one.
Returns this value incremented by one.
actual operator external fun inc(): Int
Returns this value incremented by one.
actual inline operator fun inc(): Int
Returns this value incremented by one.
actual inline operator fun inc(): Int
Returns this value incremented by one.
Inverts the bits in this value.
Inverts the bits in this value.
Inverts the bits in this value.
actual external fun inv(): Int
Inverts the bits in this value.
Inverts the bits in this value.
Inverts the bits in this value.
Subtracts the other value from this value.
Subtracts the other value from this value.
Subtracts the other value from this value.
actual inline operator fun minus(other: Byte): Int
actual operator external fun minus(other: Int): Int
Subtracts the other value from this value.
actual inline operator fun minus(other: Byte): Int
Subtracts the other value from this value.
actual inline operator fun minus(other: Byte): Int
Subtracts the other value from this value.
Calculates the remainder of flooring division of this value (dividend) by the other value (divisor).
expect infix fun or(other: Int): Int
Performs a bitwise OR operation between the two values.
actual infix fun or(other: Int): Int
Performs a bitwise OR operation between the two values.
Performs a bitwise OR operation between the two values.
actual infix external fun or(other: Int): Int
Performs a bitwise OR operation between the two values.
actual infix fun or(other: Int): Int
Performs a bitwise OR operation between the two values.
actual infix fun or(other: Int): Int
Performs a bitwise OR operation between the two values.
expect operator fun plus(other: Int): Int
Adds the other value to this value.
actual operator fun plus(other: Int): Int
Adds the other value to this value.
Adds the other value to this value.
actual inline operator fun plus(other: Byte): Int
actual operator external fun plus(other: Int): Int
actual inline operator fun plus(other: Long): Long
actual inline operator fun plus(other: Short): Int
Adds the other value to this value.
actual inline operator fun plus(other: Byte): Int
actual operator fun plus(other: Int): Int
actual inline operator fun plus(other: Long): Long
actual inline operator fun plus(other: Short): Int
Adds the other value to this value.
actual inline operator fun plus(other: Byte): Int
actual operator fun plus(other: Int): Int
actual inline operator fun plus(other: Long): Long
actual inline operator fun plus(other: Short): Int
Adds the other value to this value.
Creates a range from this value to the specified other value.
Creates a range from this value to the specified other value.
Creates a range from this value to the specified other value.
Creates a range from this value to the specified other value.
Creates a range from this value to the specified other value.
Creates a range from this value to the specified other value.
Creates a range from this value up to but excluding the specified other value.
Creates a range from this value up to but excluding the specified other value.
Creates a range from this value up to but excluding the specified other value.
Creates a range from this value up to but excluding the specified other value.
Creates a range from this value up to but excluding the specified other value.
Creates a range from this value up to but excluding the specified other value.
expect operator fun rem(other: Byte): Int
expect operator fun rem(other: Int): Int
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
actual operator fun rem(other: Byte): Int
actual operator fun rem(other: Int): Int
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
actual inline operator fun rem(other: Byte): Int
actual operator external fun rem(other: Int): Int
actual inline operator fun rem(other: Long): Long
actual inline operator fun rem(other: Short): Int
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
actual inline operator fun rem(other: Byte): Int
actual operator fun rem(other: Int): Int
actual inline operator fun rem(other: Long): Long
actual inline operator fun rem(other: Short): Int
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
actual inline operator fun rem(other: Byte): Int
actual operator fun rem(other: Int): Int
actual inline operator fun rem(other: Long): Long
actual inline operator fun rem(other: Short): Int
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
Rotates the binary representation of this Int number left by the specified bitCount number of bits. The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
Rotates the binary representation of this Int number left by the specified bitCount number of bits. The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
Rotates the binary representation of this Int number left by the specified bitCount number of bits. The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
Rotates the binary representation of this Int number left by the specified bitCount number of bits. The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
Rotates the binary representation of this Int number left by the specified bitCount number of bits. The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
Rotates the binary representation of this Int number left by the specified bitCount number of bits. The most significant bits pushed out from the left side reenter the number as the least significant bits on the right side.
Rotates the binary representation of this Int number right by the specified bitCount number of bits. The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
Rotates the binary representation of this Int number right by the specified bitCount number of bits. The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
Rotates the binary representation of this Int number right by the specified bitCount number of bits. The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
Rotates the binary representation of this Int number right by the specified bitCount number of bits. The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
Rotates the binary representation of this Int number right by the specified bitCount number of bits. The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
Rotates the binary representation of this Int number right by the specified bitCount number of bits. The least significant bits pushed out from the right side reenter the number as the most significant bits on the left side.
expect infix fun shl(bitCount: Int): Int
Shifts this value left by the bitCount number of bits.
actual infix fun shl(bitCount: Int): Int
Shifts this value left by the bitCount number of bits.
Shifts this value left by the bitCount number of bits.
actual infix external fun shl(bitCount: Int): Int
Shifts this value left by the bitCount number of bits.
actual infix fun shl(bitCount: Int): Int
Shifts this value left by the bitCount number of bits.
actual infix fun shl(bitCount: Int): Int
Shifts this value left by the bitCount number of bits.
expect infix fun shr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
actual infix fun shr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
actual infix external fun shr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
actual infix fun shr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
actual infix fun shr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the most significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the least significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the least significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the least significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the least significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the least significant set bit of this Int number, or zero, if this number is zero.
Returns a number having a single bit set in the position of the least significant set bit of this Int number, or zero, if this number is zero.
Multiplies this value by the other value.
Multiplies this value by the other value.
Multiplies this value by the other value.
actual inline operator fun times(other: Byte): Int
actual operator external fun times(other: Int): Int
Multiplies this value by the other value.
actual inline operator fun times(other: Byte): Int
Multiplies this value by the other value.
actual inline operator fun times(other: Byte): Int
Multiplies this value by the other value.
Returns a duration whose value is the specified duration value multiplied by this number.
Formats this Int
value using the specified format.
expect open override fun toInt(): Int
Returns this value.
actual open override fun toInt(): Int
Returns this value.
actual open inline override fun toInt(): Int
Returns this value.
actual open inline override fun toInt(): Int
Returns this value.
actual open inline override fun toInt(): Int
Returns this value.
Returns a string representation of this Int value in the specified radix.
Returns a string representation of this Int value in the specified radix.
Returns a string representation of this Int value in the specified radix.
Returns a string representation of this Int value in the specified radix.
Returns a string representation of this Int value in the specified radix.
Returns a string representation of this Int value in the specified radix.
Returns the negative of this value.
Returns the negative of this value.
Returns the negative of this value.
Returns the negative of this value.
Returns the negative of this value.
Returns the negative of this value.
Returns a range from this value up to but excluding the specified to value.
expect infix fun ushr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
actual infix fun ushr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
actual infix external fun ushr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
actual infix fun ushr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
actual infix fun ushr(bitCount: Int): Int
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
expect infix fun xor(other: Int): Int
Performs a bitwise XOR operation between the two values.
actual infix fun xor(other: Int): Int
Performs a bitwise XOR operation between the two values.
Performs a bitwise XOR operation between the two values.
actual infix external fun xor(other: Int): Int
Performs a bitwise XOR operation between the two values.
actual infix fun xor(other: Int): Int
Performs a bitwise XOR operation between the two values.
actual infix fun xor(other: Int): Int
Performs a bitwise XOR operation between the two values.
Thanks for your feedback!