Long (original) (raw)
Represents a 64-bit signed integer.
Since Kotlin
1.0
Represents a 64-bit signed integer.
Since Kotlin
1.1
Represents a 64-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type long
.
Since Kotlin
1.0
Represents a 64-bit signed integer.
Since Kotlin
1.3
Represents a 64-bit signed integer.
Since Kotlin
1.8
Represents a 64-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 Long number of microseconds.
Returns a Duration equal to this Long number of milliseconds.
Returns a Duration equal to this Long number of nanoseconds.
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
Performs a bitwise AND operation between the two values.
Performs a bitwise AND operation between the two values.
Performs a bitwise AND operation between the two values.
actual infix external fun and(other: Long): Long
Performs a bitwise AND operation between the two values.
Performs a bitwise AND operation between the two values.
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: Long): 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: Long): 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: Long): 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 Long number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive most significant bits that are zero in the binary representation of this Long number.
Counts the number of set bits in the binary representation of this Long number.
Counts the number of set bits in the binary representation of this Long number.
Counts the number of set bits in the binary representation of this Long number.
Counts the number of set bits in the binary representation of this Long number.
Counts the number of set bits in the binary representation of this Long number.
Counts the number of set bits in the binary representation of this Long number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Long number.
Counts the number of consecutive least significant bits that are zero in the binary representation of this Long number.
expect operator fun dec(): Long
Returns this value decremented by one.
actual operator fun dec(): Long
Returns this value decremented by one.
Returns this value decremented by one.
actual operator external fun dec(): Long
Returns this value decremented by one.
actual inline operator fun dec(): Long
Returns this value decremented by one.
actual inline operator fun dec(): Long
Returns this value decremented by one.
expect operator fun div(other: Int): Long
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): Long
actual inline operator fun div(other: Int): Long
actual inline operator fun div(other: Short): Long
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): Long
actual inline operator fun div(other: Int): Long
actual operator external fun div(other: Long): Long
actual inline operator fun div(other: Short): Long
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): Long
actual inline operator fun div(other: Int): Long
actual inline operator fun div(other: Short): Long
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): Long
actual inline operator fun div(other: Int): Long
actual inline operator fun div(other: Short): Long
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(): Long
Returns this value incremented by one.
actual operator fun inc(): Long
Returns this value incremented by one.
Returns this value incremented by one.
actual operator external fun inc(): Long
Returns this value incremented by one.
actual inline operator fun inc(): Long
Returns this value incremented by one.
actual inline operator fun inc(): Long
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(): Long
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.
actual inline operator fun minus(other: Int): Long
Subtracts the other value from this value.
Subtracts the other value from this value.
actual inline operator fun minus(other: Int): Long
actual operator external fun minus(other: Long): Long
Subtracts the other value from this value.
actual inline operator fun minus(other: Int): Long
Subtracts the other value from this value.
actual inline operator fun minus(other: Int): Long
Subtracts the other value from this value.
Calculates the remainder of flooring division of this value (dividend) by the other value (divisor).
Performs a bitwise OR operation between the two values.
Performs a bitwise OR operation between the two values.
Performs a bitwise OR operation between the two values.
actual infix external fun or(other: Long): Long
Performs a bitwise OR operation between the two values.
Performs a bitwise OR operation between the two values.
Performs a bitwise OR operation between the two values.
Adds the other value to this value.
actual inline operator fun plus(other: Byte): Long
actual inline operator fun plus(other: Int): Long
Adds the other value to this value.
Adds the other value to this value.
actual inline operator fun plus(other: Byte): Long
actual inline operator fun plus(other: Int): Long
actual operator external fun plus(other: Long): Long
Adds the other value to this value.
actual inline operator fun plus(other: Byte): Long
actual inline operator fun plus(other: Int): Long
Adds the other value to this value.
actual inline operator fun plus(other: Byte): Long
actual inline operator fun plus(other: Int): Long
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: Int): Long
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
actual inline operator fun rem(other: Byte): Long
actual inline operator fun rem(other: Int): Long
actual inline operator fun rem(other: Short): Long
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): Long
actual inline operator fun rem(other: Int): Long
actual operator external fun rem(other: Long): Long
actual inline operator fun rem(other: Short): Long
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
actual inline operator fun rem(other: Byte): Long
actual inline operator fun rem(other: Int): Long
actual inline operator fun rem(other: Short): Long
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
actual inline operator fun rem(other: Byte): Long
actual inline operator fun rem(other: Int): Long
actual inline operator fun rem(other: Short): Long
Calculates the remainder of truncating division of this value (dividend) by the other value (divisor).
Rotates the binary representation of this Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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): Long
Shifts this value left by the bitCount number of bits.
actual infix fun shl(bitCount: Int): Long
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): Long
Shifts this value left by the bitCount number of bits.
actual infix inline fun shl(bitCount: Int): Long
Shifts this value left by the bitCount number of bits.
actual infix inline fun shl(bitCount: Int): Long
Shifts this value left by the bitCount number of bits.
expect infix fun shr(bitCount: Int): Long
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): Long
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): Long
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
actual infix inline fun shr(bitCount: Int): Long
Shifts this value right by the bitCount number of bits, filling the leftmost bits with copies of the sign bit.
actual infix inline fun shr(bitCount: Int): Long
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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long 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 Long number, or zero, if this number is zero.
Multiplies this value by the other value.
actual inline operator fun times(other: Int): Long
Multiplies this value by the other value.
Multiplies this value by the other value.
actual inline operator fun times(other: Int): Long
actual operator external fun times(other: Long): Long
Multiplies this value by the other value.
actual inline operator fun times(other: Int): Long
Multiplies this value by the other value.
actual inline operator fun times(other: Int): Long
Multiplies this value by the other value.
Formats this Long
value using the specified format.
actual open inline override fun toLong(): Long
Returns this value.
actual open inline override fun toLong(): Long
Returns this value.
actual open inline override fun toLong(): Long
Returns this value.
Returns a string representation of this Long value in the specified radix.
Returns a string representation of this Long value in the specified radix.
Returns a string representation of this Long value in the specified radix.
Returns a string representation of this Long value in the specified radix.
Returns a string representation of this Long value in the specified radix.
Returns a string representation of this Long 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.
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.
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
actual infix external fun ushr(bitCount: Int): Long
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
actual infix inline fun ushr(bitCount: Int): Long
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
actual infix inline fun ushr(bitCount: Int): Long
Shifts this value right by the bitCount number of bits, filling the leftmost bits with zeros.
Performs a bitwise XOR operation between the two values.
Performs a bitwise XOR operation between the two values.
Performs a bitwise XOR operation between the two values.
actual infix external fun xor(other: Long): Long
Performs a bitwise XOR operation between the two values.
Performs a bitwise XOR operation between the two values.
Performs a bitwise XOR operation between the two values.
Thanks for your feedback!