Number
Constructors
<init>
Superclass for all platform classes representing numeric values.
<init>
(
)
Functions
toByte
Returns the value of this number as a Byte , which may involve rounding or truncation.
abstract
fun
toByte
(
)
:
Byte
toChar
Returns the Char with the numeric value equal to this number, truncated to 16 bits if appropriate.
open
fun
toChar
(
)
:
Char
toDouble
Returns the value of this number as a Double , which may involve rounding.
abstract
fun
toDouble
(
)
:
Double
toFloat
Returns the value of this number as a Float , which may involve rounding.
abstract
fun
toFloat
(
)
:
Float
toInt
Returns the value of this number as an Int , which may involve rounding or truncation.
abstract
fun
toInt
(
)
:
Int
Extension Functions
Inheritors
Byte
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
>
Double
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
>
Float
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
>
Int
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
>
Long
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
>
Short
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
>