class Double : Number, Comparable<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
.
Represents a double-precision 64-bit IEEE 754 floating point number.
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.
operator fun compareTo(other: Byte): Int
operator fun compareTo(other: Short): Int
operator fun compareTo(other: Int): Int
operator fun compareTo(other: Long): Int
operator fun compareTo(other: Float): Int
operator fun compareTo(other: Double): Int
Decrements this value.
operator fun dec(): Double
Divides this value by the other value.
operator fun div(other: Byte): Double
operator fun div(other: Short): Double
operator fun div(other: Int): Double
operator fun div(other: Long): Double
operator fun div(other: Float): Double
operator fun div(other: Double): Double
fun equals(other: Double): Boolean
Indicates whether some other object is "equal to" this one. Implementations must fulfil the following requirements:
fun equals(other: Any?): Boolean
Returns a hash code value for the object. The general contract of hashCode
is:
fun hashCode(): Int
Increments this value.
operator fun inc(): Double
Subtracts the other value from this value.
operator fun minus(other: Byte): Double
operator fun minus(other: Short): Double
operator fun minus(other: Int): Double
operator fun minus(other: Long): Double
operator fun minus(other: Float): Double
operator fun minus(other: Double): Double
Adds the other value to this value.
operator fun plus(other: Byte): Double
operator fun plus(other: Short): Double
operator fun plus(other: Int): Double
operator fun plus(other: Long): Double
operator fun plus(other: Float): Double
operator fun plus(other: Double): Double
Calculates the remainder of dividing this value by the other value.
operator fun rem(other: Byte): Double
operator fun rem(other: Short): Double
operator fun rem(other: Int): Double
operator fun rem(other: Long): Double
operator fun rem(other: Float): Double
operator fun rem(other: Double): Double
Multiplies this value by the other value.
operator fun times(other: Byte): Double
operator fun times(other: Short): Double
operator fun times(other: Int): Double
operator fun times(other: Long): Double
operator fun times(other: Float): Double
operator fun times(other: Double): Double
Returns this value.
fun toDouble(): Double
Returns a string representation of the object.
fun toString(): String
Returns the negative of this value.
operator fun unaryMinus(): Double
Returns this value.
operator fun unaryPlus(): Double
A constant holding the largest positive finite value of Double.
const val MAX_VALUE: Double
A constant holding the smallest positive nonzero value of Double.
const val MIN_VALUE: Double
A constant holding the "not a number" value of Double.
const val NaN: Double
A constant holding the negative infinity value of Double.
const val NEGATIVE_INFINITY: Double
A constant holding the positive infinity value of Double.
const val POSITIVE_INFINITY: Double
The number of bits used to represent an instance of Double in a binary form.
const val SIZE_BITS: Int
The number of bytes used to represent an instance of Double in a binary form.
const val SIZE_BYTES: Int
Ensures that this value is not less than the specified minimumValue.
fun Double.coerceAtLeast(minimumValue: Double): Double
fun <T : Comparable<T>> T.coerceAtLeast(minimumValue: T): T
Ensures that this value is not greater than the specified maximumValue.
fun Double.coerceAtMost(maximumValue: Double): Double
fun <T : Comparable<T>> T.coerceAtMost(maximumValue: T): T
Ensures that this value lies in the specified range minimumValue..maximumValue.
fun Double.coerceIn( minimumValue: Double, maximumValue: Double ): Double
fun <T : Comparable<T>> T.coerceIn( minimumValue: T?, maximumValue: T? ): T
Ensures that this value lies in the specified range.
fun <T : Comparable<T>> T.coerceIn( range: ClosedFloatingPointRange<T> ): T
fun <T : Comparable<T>> T.coerceIn(range: ClosedRange<T>): T
fun <R : Number> Number.narrow(): R
Creates a range from this Double value to the specified that value.
operator fun Double.rangeTo( that: Double ): ClosedFloatingPointRange<Double>
Creates a range from this Comparable value to the specified that value.
operator fun <T : Comparable<T>> T.rangeTo( that: T ): ClosedRange<T>
fun <R : Number> Number.signExtend(): R
Returns a duration whose value is the specified duration value multiplied by this number.
operator fun Double.times(duration: Duration): Duration
Returns the value of this Double number as a BigDecimal.
fun Double.toBigDecimal(): BigDecimal
fun Double.toBigDecimal(mathContext: MathContext): BigDecimal
© 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/-double/index.html