Number

abstract class Number(source)

Superclass for all platform classes representing numeric values.

Since Kotlin

1.0

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
abstract fun toByte(): Byte

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

Since Kotlin 1.0
Link copied to clipboard
abstract fun toChar(): Char

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

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

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

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

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

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

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

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

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

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

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

Since Kotlin 1.0