Number

expect abstract class Number(source)

Superclass for all platform classes representing numeric values.

Since Kotlin

1.0

Inheritors

actual abstract class Number(source)

Superclass for all platform classes representing numeric values.

Since Kotlin

1.1

Inheritors

actual abstract class Number(source)

Superclass for all platform classes representing numeric values.

Since Kotlin

1.0

Inheritors

actual abstract class Number(source)

Superclass for all platform classes representing numeric values.

Since Kotlin

1.3

Inheritors

Constructors

Link copied to clipboard
expect constructor()
constructor()
constructor()
constructor()

Functions

Link copied to clipboard
inline external fun <R : Number> Number.narrow(): R
Since Kotlin 1.3
Link copied to clipboard
inline external fun <R : Number> Number.signExtend(): R
Since Kotlin 1.3
Link copied to clipboard
expect abstract fun toByte(): Byte

Returns the value of this number as a Byte, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toByte(): Byte

Returns the value of this number as a Byte, which may involve rounding or truncation.

Since Kotlin 1.1
actual abstract fun toByte(): Byte

Returns the value of this number as a Byte, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toByte(): Byte

Returns the value of this number as a Byte, which may involve rounding or truncation.

Since Kotlin 1.3
Link copied to clipboard
expect open fun toChar(): Char

Returns the Char with the numeric value equal to this number, truncated to 16 bits if appropriate.

Since Kotlin 1.0
actual open fun toChar(): Char

Returns the Char with the numeric value equal to this number, truncated to 16 bits if appropriate.

Since Kotlin 1.1
actual open fun toChar(): Char

Returns the Char with the numeric value equal to this number, truncated to 16 bits if appropriate.

Since Kotlin 1.0
actual open fun toChar(): Char

Returns the Char with the numeric value equal to this number, truncated to 16 bits if appropriate.

Since Kotlin 1.3
Link copied to clipboard
expect abstract fun toDouble(): Double

Returns the value of this number as a Double, which may involve rounding.

Since Kotlin 1.0
actual abstract fun toDouble(): Double

Returns the value of this number as a Double, which may involve rounding.

Since Kotlin 1.1
actual abstract fun toDouble(): Double

Returns the value of this number as a Double, which may involve rounding.

Since Kotlin 1.0
actual abstract fun toDouble(): Double

Returns the value of this number as a Double, which may involve rounding.

Since Kotlin 1.3
Link copied to clipboard
expect abstract fun toFloat(): Float

Returns the value of this number as a Float, which may involve rounding.

Since Kotlin 1.0
actual abstract fun toFloat(): Float

Returns the value of this number as a Float, which may involve rounding.

Since Kotlin 1.1
actual abstract fun toFloat(): Float

Returns the value of this number as a Float, which may involve rounding.

Since Kotlin 1.0
actual abstract fun toFloat(): Float

Returns the value of this number as a Float, which may involve rounding.

Since Kotlin 1.3
Link copied to clipboard
expect abstract fun toInt(): Int

Returns the value of this number as an Int, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toInt(): Int

Returns the value of this number as an Int, which may involve rounding or truncation.

Since Kotlin 1.1
actual abstract fun toInt(): Int

Returns the value of this number as an Int, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toInt(): Int

Returns the value of this number as an Int, which may involve rounding or truncation.

Since Kotlin 1.3
Link copied to clipboard
expect abstract fun toLong(): Long

Returns the value of this number as a Long, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toLong(): Long

Returns the value of this number as a Long, which may involve rounding or truncation.

Since Kotlin 1.1
actual abstract fun toLong(): Long

Returns the value of this number as a Long, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toLong(): Long

Returns the value of this number as a Long, which may involve rounding or truncation.

Since Kotlin 1.3
Link copied to clipboard
expect abstract fun toShort(): Short

Returns the value of this number as a Short, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toShort(): Short

Returns the value of this number as a Short, which may involve rounding or truncation.

Since Kotlin 1.1
actual abstract fun toShort(): Short

Returns the value of this number as a Short, which may involve rounding or truncation.

Since Kotlin 1.0
actual abstract fun toShort(): Short

Returns the value of this number as a Short, which may involve rounding or truncation.

Since Kotlin 1.3