abstract class Number
Superclass for all platform classes representing numeric values.
Superclass for all platform classes representing numeric values.
<init>()
Returns the value of this number as a Byte, which may involve rounding or truncation.
abstract fun toByte(): Byte
Returns the Char with the numeric value equal to this number, truncated to 16 bits if appropriate.
abstract fun toChar(): Char
Returns the value of this number as a Double, which may involve rounding.
abstract fun toDouble(): Double
Returns the value of this number as a Float, which may involve rounding.
abstract fun toFloat(): Float
Returns the value of this number as an Int, which may involve rounding or truncation.
abstract fun toInt(): Int
fun <R : Number> Number.narrow(): R
fun <R : Number> Number.signExtend(): R
Represents a 8-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type byte
.
class Byte : Number, Comparable<Byte>
Represents a double-precision 64-bit IEEE 754 floating point number. On the JVM, non-nullable values of this type are represented as values of the primitive type double
.
class Double : Number, Comparable<Double>
Represents a single-precision 32-bit IEEE 754 floating point number. On the JVM, non-nullable values of this type are represented as values of the primitive type float
.
class Float : Number, Comparable<Float>
Represents a 32-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type int
.
class Int : Number, Comparable<Int>
Represents a 64-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type long
.
class Long : Number, Comparable<Long>
Represents a 16-bit signed integer. On the JVM, non-nullable values of this type are represented as values of the primitive type short
.
class Short : Number, Comparable<Short>
© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-number/index.html